Skip to content

Commit

Permalink
UI: Show better error notifications for schema compilation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
vigorouscoding committed Feb 26, 2024
1 parent a7dba68 commit 7734b8a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion structr-base/src/main/resources/structr/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,18 @@ let _Schema = {

let data = await response.json();

Structr.errorFromResponse(data);
let errors = new Set(data.errors.map(e => e.detail.replaceAll('\n', '<br>').replaceAll('org.structr.dynamic.', '')));

if (errors.size > 0) {

for (let error of errors) {
new ErrorMessage().title("Problem encountered compiling schema").text(error).requiresConfirmation().show();
}

} else {

Structr.errorFromResponse(data);
}
}

return response.ok;
Expand Down

0 comments on commit 7734b8a

Please sign in to comment.