#223 - Global error handler refactor
This commit is contained in:
parent
d6132edd73
commit
04cd9b2389
|
@ -30,6 +30,12 @@ function interceptor($q, $window, vnApp, $translate, $cookies) {
|
|||
let data = rejection.data;
|
||||
let error;
|
||||
|
||||
switch (rejection.xhrStatus) {
|
||||
case 'timeout':
|
||||
case 'abort':
|
||||
return $q.reject(rejection);
|
||||
}
|
||||
|
||||
if (data && data.error instanceof Object)
|
||||
error = data.error.message;
|
||||
else if (rejection.status === -1)
|
||||
|
|
|
@ -8,5 +8,6 @@
|
|||
"Ya existe un usuario con ese nombre": "Ya existe un usuario con ese nombre",
|
||||
"Quantity cannot be zero": "Quantity cannot be zero",
|
||||
"can't be blank": "can't be blank",
|
||||
"DNI Incorrecto": "DNI Incorrecto"
|
||||
"DNI Incorrecto": "DNI Incorrecto",
|
||||
"El NIF/CIF debe ser único": "El NIF/CIF debe ser único"
|
||||
}
|
Loading…
Reference in New Issue