-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add runtime exception + Javadoc exceptions + add testcase for missing…
… security dependencies
- Loading branch information
chilimannen
committed
Mar 12, 2017
1 parent
adc0cfb
commit bb88659
Showing
11 changed files
with
86 additions
and
19 deletions.
There are no files selected for viewing
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
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
34 changes: 34 additions & 0 deletions
34
core/main/java/com/codingchili/core/context/CoreRuntimeException.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.codingchili.core.context; | ||
|
||
import com.codingchili.core.context.exception.CoreExceptionFormat; | ||
import com.codingchili.core.protocol.ResponseStatus; | ||
|
||
/** | ||
* @author Robin Duda | ||
* | ||
* Runtime exception. | ||
*/ | ||
public class CoreRuntimeException extends RuntimeException implements CoreExceptionFormat { | ||
private ResponseStatus status = ResponseStatus.ERROR; | ||
|
||
/** | ||
* @param description of the generated error and the cause. | ||
*/ | ||
protected CoreRuntimeException(String description) { | ||
super(description); | ||
} | ||
|
||
/** | ||
* @param error description of the error and the cause. | ||
* @param status the error level. | ||
*/ | ||
protected CoreRuntimeException(String error, ResponseStatus status) { | ||
super(error); | ||
this.status = status; | ||
} | ||
|
||
@Override | ||
public ResponseStatus status() { | ||
return status; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
core/main/java/com/codingchili/core/context/exception/CoreExceptionFormat.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.codingchili.core.context.exception; | ||
|
||
import com.codingchili.core.protocol.ResponseStatus; | ||
|
||
/** | ||
* @author Robin Duda | ||
* | ||
* Base format for all core based exceptions. | ||
*/ | ||
public interface CoreExceptionFormat { | ||
/** | ||
* @return the error status, most likely ERROR. | ||
*/ | ||
ResponseStatus status(); | ||
} |
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
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
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
12 changes: 9 additions & 3 deletions
12
...main/java/com/codingchili/core/security/exception/SecurityMissingDependencyException.java
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
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
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
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