Skip to content

Commit

Permalink
when the error returned from interactive example server is not array …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
nashjain committed Dec 16, 2024
1 parent b10030b commit 3accfd4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/resources/templates/examples/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1744,7 +1744,7 @@ <h2 th:text="${contractFilePath}"></h2>
});

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);
Expand Down

0 comments on commit 3accfd4

Please sign in to comment.