From 3accfd40e7db4a5fef799445a212c718be262e33 Mon Sep 17 00:00:00 2001 From: Naresh Jain Date: Mon, 16 Dec 2024 22:23:35 +0530 Subject: [PATCH] when the error returned from interactive example server is not array of pairs, that means it is a validation error even before checking the examples. So we need to show such error messages in a toast and bail out to avoid the infinite spinner --- core/src/main/resources/templates/examples/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/resources/templates/examples/index.html b/core/src/main/resources/templates/examples/index.html index 1bc02de1a..d7f1c4059 100644 --- a/core/src/main/resources/templates/examples/index.html +++ b/core/src/main/resources/templates/examples/index.html @@ -1744,7 +1744,7 @@

}); if (example.error) { - if (typeof example.error === 'object' && !Array.isArray(example.error)) { + if (Array.isArray(example.error) && example.error.every(item => typeof item === 'object')) { highlightErrorLines(editor, example.error, example.exampleJson); } else { createAlert("Example Validation Failed", example.error, true);