Skip to content

Commit

Permalink
Add optional "details" field to ErrorMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
joschi committed Dec 28, 2014
1 parent 26eae3f commit dd70ee6
Showing 1 changed file with 13 additions and 3 deletions.
@@ -1,16 +1,22 @@
package io.dropwizard.jersey.errors; package io.dropwizard.jersey.errors;


public class ErrorMessage { public class ErrorMessage {
private final Integer code; private final int code;
private final String message; private final String message;
private final String details;


public ErrorMessage(String message) { public ErrorMessage(String message) {
this(500, message); this(500, message);
} }


public ErrorMessage(Integer code, String message) { public ErrorMessage(int code, String message) {
this(code, message, null);
}

public ErrorMessage(int code, String message, String details) {
this.code = code; this.code = code;
this.message = message; this.message = message;
this.details = details;
} }


public Integer getCode() { public Integer getCode() {
Expand All @@ -20,4 +26,8 @@ public Integer getCode() {
public String getMessage() { public String getMessage() {
return message; return message;
} }

public String getDetails() {
return details;
}
} }

0 comments on commit dd70ee6

Please sign in to comment.