Skip to content
This repository was archived by the owner on Jul 21, 2026. It is now read-only.

Commit 7adcc6c

Browse files
committed
Refactor schema validation error handling to throw an error instead of logging to console
1 parent 4e3325d commit 7adcc6c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/lucaValidator.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,9 @@ addFormats(lucaValidator);
6161
// Validate and add schemas
6262
Object.entries(schemas).forEach(([key, schema]) => {
6363
if (!lucaValidator.validateSchema(schema as AnySchema)) {
64-
console.error(`Invalid schema: ${key}`);
65-
console.error(lucaValidator.errors);
66-
} else {
67-
lucaValidator.addSchema(schema as AnySchema, key);
64+
throw new Error(`Invalid schema: ${key}`);
6865
}
66+
lucaValidator.addSchema(schema as AnySchema, key);
6967
});
7068

7169
export default lucaValidator as LucaValidator;

0 commit comments

Comments
 (0)