Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

MUMPFL-126 Disambigute db error from permission #48

Merged
merged 1 commit into from
Oct 12, 2015
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
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public void setUsernameAttr(String attr) {
jsonToReturn.put("people", userList);
response.setContentType("application/json");
response.getWriter().write(jsonToReturn.toString());
} catch (org.springframework.dao.DataAccessException e){
logger.error("Issue happened during lookup", e);
response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
} catch (Exception e) {
logger.error("Issue happened during lookup", e);
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
Expand Down Expand Up @@ -112,6 +115,9 @@ public void setUsernameAttr(String attr) {
response.getWriter().write("{\"emergency\":"+ emergencyContactInfoString +
" , \"local\":"+localContactInfoString+
" , \"emergencyPhoneNumbers\":"+emergencyPhoneNumbersString+"}");
} catch (org.springframework.dao.DataAccessException e){
logger.error("Issue happened during lookup", e);
response.setStatus(HttpServletResponse.SC_SERVICE_UNAVAILABLE);
} catch (Exception e) {
logger.error("Issue happened during lookup", e);
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
Expand Down
4 changes: 4 additions & 0 deletions my-profile-webapp/src/main/webapp/my-app/lec/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ define(['angular'], function(angular) {
console.warn("Error looking up search term");
if(data.status === 403) {
$scope.error = "You do not have access to this module, if you feel this is incorrect please contact your supervisor.";
} else if(data.status === 503) {
$scope.error = "Service is temporarily unavailable, please try again later."
} else {
$scope.error = "Issue looking up contact information, please try again later.";
}
Expand All @@ -75,6 +77,8 @@ define(['angular'], function(angular) {
console.warn("Error looking up person");
if(data.status === 403) {
$scope.error = "You do not have access to this module, if you feel this is incorrect please contact your supervisor.";
} else if(data.status === 503) {
$scope.error = "Service is temporarily unavailable, please try again later."
} else {
$scope.error = "Issue looking up contact information, please try again later.";
}
Expand Down