Skip to content

Commit

Permalink
Merge pull request #1656 from ballerina-platform/dilanSachi-patch-1
Browse files Browse the repository at this point in the history
[2.8.x] Add error cause to the client connector error
  • Loading branch information
TharmiganK committed Jun 7, 2023
2 parents 6ea7388 + 09f43d0 commit 0c083e7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,10 @@ public static BError createHttpError(Throwable throwable) {
IOUtils.getIOPackage());
return createHttpError("Something wrong with the connection", HttpErrorType.GENERIC_CLIENT_ERROR, cause);
} else if (throwable instanceof ClientConnectorException) {
return HttpUtil.createHttpStatusCodeError(CLIENT_CONNECTOR_ERROR, "Something wrong with the connection");
cause = createErrorCause(throwable.getMessage(), IOConstants.ErrorCode.GenericError.errorCode(),
IOUtils.getIOPackage());
return HttpUtil.createHttpStatusCodeError(CLIENT_CONNECTOR_ERROR, "Something wrong with the connection",
null, cause);
} else if (throwable instanceof NullPointerException) {
return createHttpError("Exception occurred: null", HttpErrorType.GENERIC_CLIENT_ERROR,
createHttpError(throwable.toString()));
Expand Down

0 comments on commit 0c083e7

Please sign in to comment.