Skip to content
Snippets Groups Projects
Commit 348b16c0 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire: Committed by Reiter, Christoph
Browse files

Add more error handling

parent 1884e522
No related branches found
No related tags found
No related merge requests found
{
"person-select": {
"placeholder": "Bitte wählen Sie eine Person aus"
"placeholder": "Bitte wählen Sie eine Person aus",
"error-summary": "Ein Fehler ist aufgetreten"
}
}
{
"person-select": {
"placeholder": "Please select a person"
"placeholder": "Please select a person",
"error-summary": "An error occurred"
}
}
......@@ -99,6 +99,18 @@ class PersonSelect extends VPULitElementJQuery {
return {
results: results
};
},
error: function (jqXHR, textStatus, errorThrown) {
const body = jqXHR.responseJSON !== undefined && jqXHR.responseJSON["hydra:description"] !== undefined ?
jqXHR.responseJSON["hydra:description"] : textStatus;
if (textStatus !== "abort") {
notify({
"summary": i18n.t('person-select.error-summary'),
"body": body,
"type": "danger",
});
}
}
}
}).on("select2:select", function (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment