Skip to content

Instantly share code, notes, and snippets.

@coopernurse
Created February 10, 2017 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coopernurse/951160cda1a6250932648e66d737e430 to your computer and use it in GitHub Desktop.
Save coopernurse/951160cda1a6250932648e66d737e430 to your computer and use it in GitHub Desktop.
public class FooException extends Exception {
public enum Type {
notFound(404), alreadyExists(401), emailInvalid(401);
private int httpStatusCode;
Type(int httpStatusCode) {
this.httpStatusCode = httpStatusCode;
}
public int getHttpStatusCode() {
return httpStatusCode;
}
}
private Type type;
public FooException(String msg, Type type) {
super(msg);
this.type = type;
}
public Type getType() {
return type;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment