diff --git a/common/script/public/config.js b/common/script/public/config.js
index 31be3b9a42..4805183801 100644
--- a/common/script/public/config.js
+++ b/common/script/public/config.js
@@ -33,7 +33,13 @@ angular.module('habitrpg')
// never triggered because we're in responseError
$rootScope.$broadcast('responseText', response.data.message);
} else if (response.status < 500) {
- $rootScope.$broadcast('responseError', response.data.message);
+ if (response.status === 400 && response.data.errors && _.isArray(response.data.errors)) { // bad requests with more info
+ response.data.errors.forEach(function (err) {
+ $rootScope.$broadcast('responseError', err.message);
+ });
+ } else {
+ $rootScope.$broadcast('responseError', response.data.message);
+ }
// Need to reject the prompse so the error is handled correctly
if (response.status === 401) {
return $q.reject(response);
@@ -41,7 +47,7 @@ angular.module('habitrpg')
// Error
} else {
var error = window.env.t('requestError') + '
"' +
- window.env.t('error') + ' ' + (response.data.err || response.data || 'something went wrong') +
+ window.env.t('error') + ' ' + (response.data.message || response.data.error || response.data || 'something went wrong') +
'"
' + window.env.t('seeConsole');
if (mobileApp) error = 'Error contacting the server. Please try again in a few minutes.';
$rootScope.$broadcast('responseError500', error);
diff --git a/website/client/js/controllers/authCtrl.js b/website/client/js/controllers/authCtrl.js
index cc4200e8b5..8107a543a6 100644
--- a/website/client/js/controllers/authCtrl.js
+++ b/website/client/js/controllers/authCtrl.js
@@ -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 {