DWN-39926 : pass whole exception not just the message
parent
9119dddef1
commit
46b0312715
|
@ -109,7 +109,7 @@ public class ScopeAPI {
|
||||||
try {
|
try {
|
||||||
validateScope(scope);
|
validateScope(scope);
|
||||||
} catch (ScopeException e) {
|
} 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(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.");
|
m.put(JsonErrorView.ERROR_MESSAGE, "Could not update scope. The server encountered a scope exception. Contact a system administrator for assistance.");
|
||||||
return JsonErrorView.VIEWNAME;
|
return JsonErrorView.VIEWNAME;
|
||||||
|
@ -153,7 +153,7 @@ public class ScopeAPI {
|
||||||
try {
|
try {
|
||||||
validateScope(scope);
|
validateScope(scope);
|
||||||
} catch (ScopeException e) {
|
} 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(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.");
|
m.put(JsonErrorView.ERROR_MESSAGE, "Could not create scope. The server encountered a scope exception. Contact a system administrator for assistance.");
|
||||||
return JsonErrorView.VIEWNAME;
|
return JsonErrorView.VIEWNAME;
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class WhitelistAPI {
|
||||||
whitelist = gson.fromJson(json, WhitelistedSite.class);
|
whitelist = gson.fromJson(json, WhitelistedSite.class);
|
||||||
validateWhitelistScopes(whitelist.getAllowedScopes());
|
validateWhitelistScopes(whitelist.getAllowedScopes());
|
||||||
} catch (ScopeException e) {
|
} 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(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.");
|
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;
|
return JsonErrorView.VIEWNAME;
|
||||||
|
@ -149,7 +149,7 @@ public class WhitelistAPI {
|
||||||
whitelist = gson.fromJson(json, WhitelistedSite.class);
|
whitelist = gson.fromJson(json, WhitelistedSite.class);
|
||||||
validateWhitelistScopes(whitelist.getAllowedScopes());
|
validateWhitelistScopes(whitelist.getAllowedScopes());
|
||||||
} catch (ScopeException e) {
|
} 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(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.");
|
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;
|
return JsonErrorView.VIEWNAME;
|
||||||
|
|
Loading…
Reference in New Issue