-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#25] Make ACA exception handling more descriptive
- Loading branch information
Showing
14 changed files
with
306 additions
and
70 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
22 changes: 22 additions & 0 deletions
22
HIRS_AttestationCA/src/main/java/hirs/attestationca/AcaRestError.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,22 @@ | ||
package hirs.attestationca; | ||
|
||
public class AcaRestError { | ||
|
||
private String error; | ||
|
||
// Don't remove this constructor as it's required for JSON mapping | ||
public AcaRestError() { } | ||
|
||
public AcaRestError(String error) { | ||
this.error = error; | ||
} | ||
|
||
public String getError() { | ||
return error; | ||
} | ||
|
||
public void setError(final String error) { | ||
this.error = error; | ||
} | ||
|
||
} |
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
27 changes: 27 additions & 0 deletions
27
...stationCA/src/main/java/hirs/attestationca/exceptions/CertificateProcessingException.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,27 @@ | ||
package hirs.attestationca.exceptions; | ||
|
||
/** | ||
* Generic exception thrown while a {@link hirs.attestationca.AttestationCertificateAuthority} | ||
* is processing a newly created Attestation Certificate for a validated identity. | ||
*/ | ||
public class CertificateProcessingException extends RuntimeException { | ||
/** | ||
* Constructs a generic instance of this exception using the specified reason. | ||
* | ||
* @param reason for the exception | ||
*/ | ||
public CertificateProcessingException(final String reason) { | ||
super(reason); | ||
} | ||
|
||
/** | ||
* Constructs a instance of this exception with the specified reason and backing root | ||
* exception. | ||
* | ||
* @param reason for this exception | ||
* @param rootException causing this exception | ||
*/ | ||
public CertificateProcessingException(final String reason, final Throwable rootException) { | ||
super(reason, rootException); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
...tationca/IdentityProcessingException.java → ...ceptions/IdentityProcessingException.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
27 changes: 27 additions & 0 deletions
27
..._AttestationCA/src/main/java/hirs/attestationca/exceptions/UnexpectedServerException.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,27 @@ | ||
package hirs.attestationca.exceptions; | ||
|
||
/** | ||
* Generic exception thrown when a {@link hirs.attestationca.AttestationCertificateAuthority} | ||
* encounters an unexpected condition that can't be handled. | ||
*/ | ||
public class UnexpectedServerException extends RuntimeException { | ||
/** | ||
* Constructs a generic instance of this exception using the specified reason. | ||
* | ||
* @param reason for the exception | ||
*/ | ||
public UnexpectedServerException(final String reason) { | ||
super(reason); | ||
} | ||
|
||
/** | ||
* Constructs a instance of this exception with the specified reason and backing root | ||
* exception. | ||
* | ||
* @param reason for this exception | ||
* @param rootException causing this exception | ||
*/ | ||
public UnexpectedServerException(final String reason, final Throwable rootException) { | ||
super(reason, rootException); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
HIRS_AttestationCA/src/main/java/hirs/attestationca/exceptions/package-info.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,4 @@ | ||
/** | ||
* Custom exceptions of the {@link hirs.attestationca.AttestationCertificateAuthority}. | ||
*/ | ||
package hirs.attestationca.exceptions; |
Oops, something went wrong.