mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Improve display of "no response from server" message
This commit is contained in:
parent
e303b5a39b
commit
db31bf91e6
@ -61,7 +61,11 @@ function inventreeGet(url, filters={}, options={}) {
|
|||||||
},
|
},
|
||||||
error: function(xhr, ajaxOptions, thrownError) {
|
error: function(xhr, ajaxOptions, thrownError) {
|
||||||
console.error('Error on GET at ' + url);
|
console.error('Error on GET at ' + url);
|
||||||
console.error(thrownError);
|
|
||||||
|
if (thrownError) {
|
||||||
|
console.error('Error: ' + thrownError);
|
||||||
|
}
|
||||||
|
|
||||||
if (options.error) {
|
if (options.error) {
|
||||||
options.error({
|
options.error({
|
||||||
error: thrownError
|
error: thrownError
|
||||||
@ -174,7 +178,7 @@ function showApiError(xhr, url) {
|
|||||||
var title = null;
|
var title = null;
|
||||||
var message = null;
|
var message = null;
|
||||||
|
|
||||||
switch (xhr.status) {
|
switch (xhr.status || 0) {
|
||||||
// No response
|
// No response
|
||||||
case 0:
|
case 0:
|
||||||
title = '{% trans "No Response" %}';
|
title = '{% trans "No Response" %}';
|
||||||
|
Loading…
Reference in New Issue
Block a user