mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
v3 client: more user friendly errors
This commit is contained in:
@@ -28,6 +28,10 @@ angular.module('habitrpg')
|
||||
$scope.registrationInProgress = false;
|
||||
if (status === 0) {
|
||||
$window.alert(window.env.t('noReachServer'));
|
||||
} else if (status === 400 && data.errors && _.isArray(data.errors)) { // bad requests
|
||||
data.errors.forEach(function (err) {
|
||||
$window.alert(err.message);
|
||||
});
|
||||
} else if (!!data && !!data.error) {
|
||||
$window.alert(data.message);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user