Skip to content
Snippets Groups Projects
Commit ab68dcd2 authored by Andreas Valder's avatar Andreas Valder
Browse files

added error handling to the moderator api in the frontend as requested in #138

parent a13befd0
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,7 @@ var moderator = { ...@@ -17,6 +17,7 @@ var moderator = {
dataType: "text", dataType: "text",
contentType: "application/json", contentType: "application/json",
data: JSON.stringify(dict), data: JSON.stringify(dict),
error: moderator.api.handleapierror,
success: function () { success: function () {
if (reload) { if (reload) {
window.location.reload(); window.location.reload();
...@@ -32,6 +33,7 @@ var moderator = { ...@@ -32,6 +33,7 @@ var moderator = {
dataType: "text", dataType: "text",
contentType: "application/json", contentType: "application/json",
data: JSON.stringify(value), data: JSON.stringify(value),
error: moderator.api.handleapierror,
success: function () { success: function () {
if (reload) { if (reload) {
window.location.reload(); window.location.reload();
...@@ -39,6 +41,9 @@ var moderator = { ...@@ -39,6 +41,9 @@ var moderator = {
} }
}) })
}, },
handleapierror: function(jqXHR, textStatus, errorThrow) {
alert("Fehler: "+errorThrow)
},
gethttp: function (url){ gethttp: function (url){
$.ajax({ $.ajax({
method: "GET", method: "GET",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment