Created
February 10, 2017 23:01
-
-
Save coopernurse/951160cda1a6250932648e66d737e430 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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