Skip to content

Commit b9cb09a

Browse files
authored
Merge branch 'main' into enh-schema-uri
2 parents 916fccc + 038e8bd commit b9cb09a

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Changed
2+
3+
- Throw an error if specified schema (e.g. via `--schema` or `BIDS_SCHEMA` env
4+
var) could not be loaded.

src/setup/loadSchema.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export interface SchemaWithSource {
1111
/**
1212
* Load the schema from the specification with source tracking
1313
*
14-
* version is ignored when the network cannot be accessed
1514
*/
1615
export async function loadSchemaWithSource(version?: string): Promise<SchemaWithSource> {
1716
let schemaUrl = version
@@ -38,10 +37,10 @@ export async function loadSchemaWithSource(version?: string): Promise<SchemaWith
3837
) as Schema
3938
actualSchemaSource = schemaUrl
4039
} catch (error) {
41-
// No network access or other errors
40+
// If a custom schema URL was explicitly provided, fail rather than falling back
4241
console.error(error)
43-
console.error(
44-
`Warning, could not load schema from ${schemaUrl}, falling back to internal version`,
42+
throw new Error(
43+
`Failed to load schema from ${schemaUrl}: ${error instanceof Error ? error.message : String(error)}`,
4544
)
4645
}
4746
}

0 commit comments

Comments
 (0)