-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Exception throw on error query response (#20)
* add Exception throw on error query response Signed-off-by: Alexey Chernyshov <[email protected]> * fix PR issues Signed-off-by: Alexey Chernyshov <[email protected]> * Fix PR issues Signed-off-by: Alexey Chernyshov <[email protected]>
- Loading branch information
1 parent
97b4bfe
commit 5b16f7f
Showing
3 changed files
with
79 additions
and
2 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
client/src/main/java/jp/co/soramitsu/iroha/java/ErrorResponseException.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,18 @@ | ||
package jp.co.soramitsu.iroha.java; | ||
|
||
import iroha.protocol.QryResponses.ErrorResponse; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
|
||
@Getter | ||
public class ErrorResponseException extends RuntimeException { | ||
|
||
@NonNull | ||
private ErrorResponse errorResponse; | ||
|
||
public ErrorResponseException(ErrorResponse errorResponse) { | ||
super("Error code: " + errorResponse.getErrorCode() + ". Reason: " + errorResponse.getReason() | ||
+ ". Message: " + errorResponse.getMessage()); | ||
this.errorResponse = errorResponse; | ||
} | ||
} |
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