File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4,14 +4,20 @@ import buildMessage from 'ember-changeset-validations/utils/validation-errors';
44import DraftNode from 'ember-osf-web/models/draft-node' ;
55import File from 'ember-osf-web/models/file' ;
66import NodeModel from 'ember-osf-web/models/node' ;
7+ import captureException from 'ember-osf-web/utils/capture-exception' ;
78
89export function validateFileList ( responseKey : string , node ?: NodeModel | DraftNode ) : ValidatorFunction {
910 return async ( _ : string , newValue : File [ ] ) => {
1011 if ( newValue && node ) {
1112 for ( const file of newValue ) {
1213 if ( file && ! file . isError ) {
13- // eslint-disable-next-line no-await-in-loop
14- await file . reload ( ) ;
14+ try {
15+ // validating these in sequence to prevent the files-burst throttling of API
16+ // eslint-disable-next-line no-await-in-loop
17+ await file . reload ( ) ;
18+ } catch ( e ) {
19+ captureException ( e ) ;
20+ }
1521 }
1622 }
1723
You can’t perform that action at this time.
0 commit comments