Display more errors

This commit is contained in:
Oliver 2021-11-04 10:17:38 +11:00
parent b6d48cab2a
commit 4118f98d4d

View File

@ -68,6 +68,8 @@ function inventreeGet(url, filters={}, options={}) {
options.error({
error: thrownError
});
} else {
showApiError(xhr, url);
}
}
});
@ -104,6 +106,8 @@ function inventreeFormDataUpload(url, data, options={}) {
if (options.error) {
options.error(xhr, status, error);
} else {
showApiError(xhr, url);
}
}
});
@ -139,6 +143,8 @@ function inventreePut(url, data={}, options={}) {
} else {
console.error(`Error on ${method} to '${url}' - STATUS ${xhr.status}`);
console.error(thrownError);
showApiError(xhr, url);
}
},
complete: function(xhr, status) {
@ -162,7 +168,9 @@ function inventreeDelete(url, options={}) {
return inventreePut(url, {}, options);
}
/*
* Display a notification with error information
*/
function showApiError(xhr, url) {
var title = null;