Skip to content

Instantly share code, notes, and snippets.

@h4t0n
Last active December 4, 2018 22:35
Show Gist options
  • Save h4t0n/d2d3c292073c47a604ee5501bbf48b18 to your computer and use it in GitHub Desktop.
Save h4t0n/d2d3c292073c47a604ee5501bbf48b18 to your computer and use it in GitHub Desktop.
Spring Error Handling Pattern
public class GeminiException extends Exception {
String errorCodeName;
protected GeminiException(String errorCodeName) {
super(errorCodeName);
this.errorCodeName = errorCodeName;
}
protected GeminiException(String errorCodeName, String message) {
super(message);
this.errorCodeName = errorCodeName;
}
protected GeminiException(String errorCodeName, Exception e) {
super(e);
this.errorCodeName = errorCodeName;
}
public String getErrorCodeName() {
return errorCodeName;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment