mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Display more errors
This commit is contained in:
parent
b6d48cab2a
commit
4118f98d4d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user