Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues/260 - Fixed issue with CasperClientException not displaying data message #261

Merged
merged 2 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading