-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds complete exception hierarchy and full error code / exception map…
…ping from szerrors.json (#79) * - Added missing exception classes to the class hierarchy - Added full exception mapping according to szerrors.json from sz-sdk-errors * Updated CHANGELOG.md for 0.9.1 release * Resolved most linting issues * Suppressed the MethodLength style check for the SzExceptionMapper.java file
- Loading branch information
1 parent
71e1af8
commit add8804
Showing
15 changed files
with
1,673 additions
and
481 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
72 changes: 72 additions & 0 deletions
72
src/main/java/com/senzing/sdk/SzConfigurationException.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,72 @@ | ||
package com.senzing.sdk; | ||
|
||
/** | ||
* Defines an exceptional condition when a failure has occurred | ||
* pertaining to the Senzing configuration. | ||
*/ | ||
public class SzConfigurationException extends SzException { | ||
/** | ||
* Default constructor. | ||
*/ | ||
public SzConfigurationException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzConfigurationException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzConfigurationException(int errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
/** | ||
* Constructs with the {@link Throwable} that is the underlying cause | ||
* for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzConfigurationException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception | ||
* and the {@link Throwable} that is the underlying cause for the | ||
* exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzConfigurationException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs with the Senzing error code, the message explaing | ||
* the reason for the exception and the {@link Throwable} that | ||
* is the underlying cause for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzConfigurationException(int errorCode, String message, Throwable cause) { | ||
super(errorCode, message, cause); | ||
} | ||
} |
74 changes: 74 additions & 0 deletions
74
src/main/java/com/senzing/sdk/SzDatabaseConnectionLostException.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,74 @@ | ||
package com.senzing.sdk; | ||
|
||
/** | ||
* Extends {@link SzRetryableException} to define an exceptional condition | ||
* where a database connection was lost causing a Senzing operation to fail. | ||
* Retrying the operation would likely result in the connection being | ||
* reestablished and the operation succeeding. | ||
*/ | ||
public class SzDatabaseConnectionLostException extends SzRetryableException { | ||
/** | ||
* Default constructor. | ||
*/ | ||
public SzDatabaseConnectionLostException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseConnectionLostException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseConnectionLostException(int errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
/** | ||
* Constructs with the {@link Throwable} that is the underlying cause | ||
* for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseConnectionLostException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception | ||
* and the {@link Throwable} that is the underlying cause for the | ||
* exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseConnectionLostException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs with the Senzing error code, the message explaing | ||
* the reason for the exception and the {@link Throwable} that | ||
* is the underlying cause for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseConnectionLostException(int errorCode, String message, Throwable cause) { | ||
super(errorCode, message, cause); | ||
} | ||
} |
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,73 @@ | ||
package com.senzing.sdk; | ||
|
||
/** | ||
* Extends {@link SzUnrecoverableException} to define an exceptional | ||
* condition triggered by a database error from which we can recover | ||
* (e.g.: missing or unexpected schema definition). | ||
*/ | ||
public class SzDatabaseException extends SzUnrecoverableException { | ||
/** | ||
* Default constructor. | ||
*/ | ||
public SzDatabaseException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseException(int errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
/** | ||
* Constructs with the {@link Throwable} that is the underlying cause | ||
* for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception | ||
* and the {@link Throwable} that is the underlying cause for the | ||
* exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs with the Senzing error code, the message explaing | ||
* the reason for the exception and the {@link Throwable} that | ||
* is the underlying cause for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzDatabaseException(int errorCode, String message, Throwable cause) { | ||
super(errorCode, message, cause); | ||
} | ||
} |
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,73 @@ | ||
package com.senzing.sdk; | ||
|
||
/** | ||
* Extends {@link SzUnrecoverableException} to define an exceptional | ||
* condition triggered by an invalid, expired or exhausted Senzing | ||
* license. | ||
*/ | ||
public class SzLicenseException extends SzUnrecoverableException { | ||
/** | ||
* Default constructor. | ||
*/ | ||
public SzLicenseException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzLicenseException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzLicenseException(int errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
/** | ||
* Constructs with the {@link Throwable} that is the underlying cause | ||
* for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzLicenseException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception | ||
* and the {@link Throwable} that is the underlying cause for the | ||
* exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzLicenseException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs with the Senzing error code, the message explaing | ||
* the reason for the exception and the {@link Throwable} that | ||
* is the underlying cause for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzLicenseException(int errorCode, String message, Throwable cause) { | ||
super(errorCode, message, cause); | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
src/main/java/com/senzing/sdk/SzNotInitializedException.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,72 @@ | ||
package com.senzing.sdk; | ||
|
||
/** | ||
* Extends {@link SzUnrecoverableException} to define an exceptional | ||
* condition triggered by Senzing not being initialized. | ||
*/ | ||
public class SzNotInitializedException extends SzUnrecoverableException { | ||
/** | ||
* Default constructor. | ||
*/ | ||
public SzNotInitializedException() { | ||
super(); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzNotInitializedException(String message) { | ||
super(message); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
*/ | ||
public SzNotInitializedException(int errorCode, String message) { | ||
super(errorCode, message); | ||
} | ||
|
||
/** | ||
* Constructs with the {@link Throwable} that is the underlying cause | ||
* for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzNotInitializedException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
/** | ||
* Constructs with a message explaing the reason for the exception | ||
* and the {@link Throwable} that is the underlying cause for the | ||
* exception. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzNotInitializedException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
/** | ||
* Constructs with the Senzing error code, the message explaing | ||
* the reason for the exception and the {@link Throwable} that | ||
* is the underlying cause for the exception. | ||
* | ||
* @param errorCode The underlying senzing error code. | ||
* | ||
* @param message The message explaining the reason for the exception. | ||
* | ||
* @param cause The message The message explaining the reason for the exception. | ||
*/ | ||
public SzNotInitializedException(int errorCode, String message, Throwable cause) { | ||
super(errorCode, message, cause); | ||
} | ||
} |
Oops, something went wrong.