DWN-39926 : pass whole exception not just the message

pull/1601/head
Harry Smith 2023-01-26 10:10:52 +00:00
parent 9119dddef1
commit 46b0312715
2 changed files with 4 additions and 4 deletions

View File

@ -109,7 +109,7 @@ public class ScopeAPI {
try {
validateScope(scope);
} catch (ScopeException e) {
logger.error("updateScope failed due to ScopeException. {}", e.getMessage());
logger.error("updateScope failed due to ScopeException", e);
m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
m.put(JsonErrorView.ERROR_MESSAGE, "Could not update scope. The server encountered a scope exception. Contact a system administrator for assistance.");
return JsonErrorView.VIEWNAME;
@ -153,7 +153,7 @@ public class ScopeAPI {
try {
validateScope(scope);
} catch (ScopeException e) {
logger.error("createScope failed due to ScopeException. {}", e.getMessage());
logger.error("createScope failed due to ScopeException", e);
m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
m.put(JsonErrorView.ERROR_MESSAGE, "Could not create scope. The server encountered a scope exception. Contact a system administrator for assistance.");
return JsonErrorView.VIEWNAME;

View File

@ -107,7 +107,7 @@ public class WhitelistAPI {
whitelist = gson.fromJson(json, WhitelistedSite.class);
validateWhitelistScopes(whitelist.getAllowedScopes());
} catch (ScopeException e) {
logger.error("addNewWhitelistedSite failed due to ScopeException. {}", e.getMessage());
logger.error("addNewWhitelistedSite failed due to ScopeException", e);
m.addAttribute(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
m.addAttribute(JsonErrorView.ERROR_MESSAGE, "Could not save new whitelisted site. The server encountered a scopes exception. Contact a system administrator for assistance.");
return JsonErrorView.VIEWNAME;
@ -149,7 +149,7 @@ public class WhitelistAPI {
whitelist = gson.fromJson(json, WhitelistedSite.class);
validateWhitelistScopes(whitelist.getAllowedScopes());
} catch (ScopeException e) {
logger.error("updateWhitelistedSite failed due to ScopeException. {}", e.getMessage());
logger.error("updateWhitelistedSite failed due to ScopeException", e);
m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);
m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The server encountered a scope exception. Contact a system administrator for assistance.");
return JsonErrorView.VIEWNAME;