From 84e8161e69ed4b4967fb9dfcea8828c7a980732e Mon Sep 17 00:00:00 2001 From: martinRenou Date: Thu, 5 Dec 2024 10:35:01 +0100 Subject: [PATCH] Improve file validation warning message (#641) --- packages/schema/src/model.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/schema/src/model.ts b/packages/schema/src/model.ts index 2fc502b8..c670b316 100644 --- a/packages/schema/src/model.ts +++ b/packages/schema/src/model.ts @@ -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(() => {