Skip to content

Instantly share code, notes, and snippets.

@achyutdev
Created July 23, 2016 23:04
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 achyutdev/22d41ac2c50718bb3a42a990840b0659 to your computer and use it in GitHub Desktop.
Save achyutdev/22d41ac2c50718bb3a42a990840b0659 to your computer and use it in GitHub Desktop.
public enum Error {
DATABASE(0, "A database error has occured."),
DUPLICATE_USER(1, "This user already exists.");
private final int code;
private final String description;
private Error(int code, String description) {
this.code = code;
this.description = description;
}
public String getDescription() {
return description;
}
public int getCode() {
return code;
}
@Override
public String toString() {
return code + ": " + description;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment