Improve display of "no response from server" message

This commit is contained in:
Oliver 2021-11-09 22:41:54 +11:00
parent e303b5a39b
commit db31bf91e6

View File

@ -61,7 +61,11 @@ function inventreeGet(url, filters={}, options={}) {
},
error: function(xhr, ajaxOptions, thrownError) {
console.error('Error on GET at ' + url);
console.error(thrownError);
if (thrownError) {
console.error('Error: ' + thrownError);
}
if (options.error) {
options.error({
error: thrownError
@ -174,7 +178,7 @@ function showApiError(xhr, url) {
var title = null;
var message = null;
switch (xhr.status) {
switch (xhr.status || 0) {
// No response
case 0:
title = '{% trans "No Response" %}';