mirror of
https://github.com/brmlab/wekan-mailer.git
synced 2025-08-02 12:53:38 +02:00
Prepare exception and error codes for error handling
This commit is contained in:
parent
9402c79d3f
commit
22b4879933
2 changed files with 29 additions and 0 deletions
|
@ -0,0 +1,9 @@
|
|||
package cz.brmlab.wm.utils.Exceptions;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BrmException extends Exception {
|
||||
private final String message;
|
||||
private final ExitCode exitCode;
|
||||
}
|
20
src/main/java/cz/brmlab/wm/utils/Exceptions/ExitCode.java
Normal file
20
src/main/java/cz/brmlab/wm/utils/Exceptions/ExitCode.java
Normal file
|
@ -0,0 +1,20 @@
|
|||
package cz.brmlab.wm.utils.Exceptions;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
public enum ExitCode {
|
||||
|
||||
CONFIGURATION_MISSING(10, "Missing configuration property: ");
|
||||
|
||||
@Getter
|
||||
private String reason;
|
||||
@Getter
|
||||
private int code;
|
||||
|
||||
ExitCode(int code, String reason) {
|
||||
this.code = code;
|
||||
this.reason = reason;
|
||||
}
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue