Skip to content

Commit

Permalink
normalized Java and Jsp connectors error format according to JSON API…
Browse files Browse the repository at this point in the history
… standard #210
  • Loading branch information
psolom committed Nov 24, 2017
1 parent 4521346 commit c985ae4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ protected final JSONObject getErrorResponse(String msg) {
try {
errorInfo.put("id", "server");
errorInfo.put("code", "500");
errorInfo.put("message", msg);
errorInfo.put("title", msg);

} catch (JSONException e) {
logger.error("JSONObject error");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ protected final JSONObject getErrorResponse(String msg, Exception ex) throws JSO
try {
errorInfo.put("id", "server");
errorInfo.put("code", "500");
errorInfo.put("message", msg);
errorInfo.put("title", msg);

if (propertiesConfig.getProperty("errorObject_arguments_redirect") != null
&& !propertiesConfig.getProperty("errorObject_arguments_redirect").equals("")) {
JSONObject redirect = new JSONObject();
redirect.put("redirect", propertiesConfig.getProperty("errorObject_arguments_redirect"));
errorInfo.put("arguments",redirect);
JSONObject arguments = new JSONObject();
arguments.put("redirect", propertiesConfig.getProperty("errorObject_arguments_redirect"));
errorInfo.put("meta", arguments);
} else {
errorInfo.put("arguments", new JSONObject());
errorInfo.put("meta", new JSONObject());
}

if (ex != null) {
Expand Down

0 comments on commit c985ae4

Please sign in to comment.