File tree 2 files changed +24
-8
lines changed
2 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -192,8 +192,12 @@ export class BIDSContext implements Context {
192
192
}
193
193
for ( const file of sidecars ) {
194
194
const json = await loadJSON ( file ) . catch ( ( error ) => {
195
- this . dataset . issues . add ( { code : error . key , location : file . path } )
196
- return { }
195
+ if ( error . key ) {
196
+ this . dataset . issues . add ( { code : error . key , location : file . path } )
197
+ return { }
198
+ } else {
199
+ throw error
200
+ }
197
201
} )
198
202
this . sidecar = { ...json , ...this . sidecar }
199
203
Object . keys ( json ) . map ( ( x ) => this . sidecarKeyOrigin [ x ] ??= file . path )
@@ -210,8 +214,12 @@ export class BIDSContext implements Context {
210
214
) return
211
215
212
216
this . nifti_header = await loadHeader ( this . file ) . catch ( ( error ) => {
213
- this . dataset . issues . add ( { code : error . key , location : this . file . path } )
214
- return undefined
217
+ if ( error . key ) {
218
+ this . dataset . issues . add ( { code : error . key , location : this . file . path } )
219
+ return undefined
220
+ } else {
221
+ throw error
222
+ }
215
223
} )
216
224
}
217
225
@@ -244,8 +252,12 @@ export class BIDSContext implements Context {
244
252
return
245
253
}
246
254
this . json = await loadJSON ( this . file ) . catch ( ( error ) => {
247
- this . dataset . issues . add ( { code : error . key , location : this . file . path } )
248
- return { }
255
+ if ( error . key ) {
256
+ this . dataset . issues . add ( { code : error . key , location : this . file . path } )
257
+ return { }
258
+ } else {
259
+ throw error
260
+ }
249
261
} )
250
262
}
251
263
Original file line number Diff line number Diff line change @@ -56,8 +56,12 @@ export async function validate(
56
56
const dsContext = new BIDSContextDataset ( { options, schema, tree : fileTree } )
57
57
if ( ddFile ) {
58
58
dsContext . dataset_description = await loadJSON ( ddFile ) . catch ( ( error ) => {
59
- dsContext . issues . add ( { code : error . key , location : ddFile . path } )
60
- return { } as Record < string , unknown >
59
+ if ( error . key ) {
60
+ dsContext . issues . add ( { code : error . key , location : ddFile . path } )
61
+ return { } as Record < string , unknown >
62
+ } else {
63
+ throw error
64
+ }
61
65
} )
62
66
summary . dataProcessed = dsContext . dataset_description . DatasetType === 'derivative'
63
67
} else {
You can’t perform that action at this time.
0 commit comments