diff --git a/InvenTree/templates/js/translated/api.js b/InvenTree/templates/js/translated/api.js index cdd59a7fe5..573bc7ed80 100644 --- a/InvenTree/templates/js/translated/api.js +++ b/InvenTree/templates/js/translated/api.js @@ -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;