Skip to content

Commit 4293b40

Browse files
committed
Fix tests
1 parent eeb6964 commit 4293b40

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/aspose/barcode/cloud/ApiClient.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,10 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
680680
response.message(), e, response.code(), response.headers().toMultimap());
681681
}
682682

683-
throw new ApiException(response.message(), response.code(), errorResponse);
683+
throw new ApiException(
684+
response.message().isEmpty() ? String.valueOf(response.code()) : response.message(),
685+
response.code(),
686+
errorResponse);
684687
}
685688

686689
/**

src/test/java/com/aspose/barcode/cloud/test/ExceptionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public void ExceptionMessageParsed() {
3131
} catch (ApiException e) {
3232
thrown = true;
3333
assertEquals(400, e.getHttpCode());
34-
assertEquals("com.aspose.barcode.cloud.ApiException: Bad Request", e.toString());
34+
assertEquals("com.aspose.barcode.cloud.ApiException: 400", e.toString());
3535
assertEquals(
3636
"errorInvalidInputData: Barcode.Text is not provided.\n"
3737
+ "Operation Failed. The input data is not valid.",

0 commit comments

Comments
 (0)