Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANGOLASUP-917: error body request is not json #176

Merged
merged 2 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/messages_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"openlmisServerErrorHandler.serverResponse.error": "There was an error with this request, please contact the server administrator.",
"openlmisServerErrorHandler.badCredentials": "Authentication error",
"openlmisServerErrorHandler.badRequest": "Bad Request",
"openlmisServerErrorHandler.badGateway": "Bad Gateway",
"openlmisServerErrorHandler.gatewayTimeoutError": "Gateway timeout error",
"openlmisLogin.appHeader": "Logistics Management Information System",
"openlmisSupport.title": "Contact support",
Expand Down
6 changes: 5 additions & 1 deletion src/openlmis-login/login-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@
// ANGOLASUP-510: ends here
})
.catch(function(error) {
vm.loginError = error;
vm.password = undefined;
if (error.status) {
vm.loginError = '';
} else {
vm.loginError = error;
}
})
.finally(loadingModalService.close);
}
Expand Down
2 changes: 1 addition & 1 deletion src/openlmis-login/login.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
})
// AO-223: translate error message after passing bad credentials to login modal
.catch(function(message) {
alertService.error('openlmisServerErrorHandler.badCredentials', message);
alertService.error('openlmisServerErrorHandler.badCredentials');
return $q.reject(message);
});
// AO-223: ends here
Expand Down
17 changes: 17 additions & 0 deletions src/openlmis-modal/alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="modal alert-modal {{vm.alertClass}}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<div class="alert-main">
<div class="alert-message">
<h2>{{vm.title | message}}</h2>
<div ng-bind-html="vm.message"></div>
</div>
</div>
</div>
<div class="modal-footer">
<button ng-click="vm.close()">{{vm.buttonLabel | message}}</button>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
$injector.get('alertService')
.error('openlmisServerErrorHandler.gatewayTimeoutError');
}, 200);
}
if (response.status === 502) {
$timeout(function() {
$injector.get('alertService')
.error('openlmisServerErrorHandler.badGateway');
}, 200);
// AO-442: ends here
} else if (response.status >= 400 && response.status < 600 && response.status !== 401) {
$timeout(function() {
Expand Down
Loading