Skip to content

Commit

Permalink
Improve file validation warning message (#641)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou authored Dec 5, 2024
1 parent 7261ca1 commit 84e8161
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/schema/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ export class JupyterCadModel implements IJupyterCadModel {
const valid = validate(jsonData);

if (!valid) {
console.warn('JupyterCAD File format invalid', data);
let errorMsg = 'JupyterCAD File format invalid:\n';
for (const error of validate.errors || []) {
errorMsg = `${errorMsg}- ${error.instancePath} ${error.message}\n`;
}
console.warn(errorMsg);
}

this.sharedModel.transact(() => {
Expand Down

0 comments on commit 84e8161

Please sign in to comment.