Skip to content

Commit

Permalink
Merge pull request #261 from /issues/260
Browse files Browse the repository at this point in the history
Issues/260 - Fixed issue with CasperClientException not displaying data message
  • Loading branch information
cnorburn authored Apr 15, 2024
2 parents 8d1ef64 + 7664570 commit 6c2467c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
*/
public class CasperClientException extends RuntimeException {

public CasperClientException(CasperClientErrorData error) {
super(String.format("%s (code: %d)", error.getMessage(), error.getCode()));
public CasperClientException(final CasperClientErrorData error) {
super(String.format("%s (code: %d)%s", error.getMessage(), error.getCode(), error.getData() != null ? " " + error.getData() : ""));
}

public CasperClientException(String message, Throwable cause) {
public CasperClientException(final String message, final Throwable cause) {
super(message, cause);
}

public CasperClientException(String message) {
public CasperClientException(final String message) {
super(message);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ void getCasperClientExceptionExceptionBlockNotKnown() {
.withBody("$.params.deploy_hash", "abc")
.thenDispatch(getClass().getResource("/deploy-samples/info_get_deploy_error.json"));

final String expectedMessage = "Invalid params (code: -32602)";
final String expectedMessage = "Invalid params (code: -32602) Failed to parse 'params' field: could not convert slice to array";

final CasperClientException casperClientException = assertThrows(CasperClientException.class,
() -> casperServiceMock.getDeploy("abc"));
Expand Down

0 comments on commit 6c2467c

Please sign in to comment.