Skip to content

Commit c6cd7c4

Browse files
committed
Updated sources
1 parent 1666e20 commit c6cd7c4

File tree

5 files changed

+23
-6
lines changed

5 files changed

+23
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "groupdocs-conversion-cloud",
3-
"version": "21.4.0",
3+
"version": "21.4.1",
44
"description": "GroupDocs.Conversion Cloud SDK for Node.js",
55
"homepage": "https://products.groupdocs.cloud/conversion",
66
"author": {

src/api_client.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,17 @@ async function invokeApiMethodInternal(requestOptions: request.Options, config:
9999
bodyContent = JSON.parse(bodyContent.toString("utf8"));
100100
}
101101
if (bodyContent.error) {
102-
reject({ message: bodyContent.error, code: response.statusCode });
103-
} else if (bodyContent.Error) {
104-
reject({ message: bodyContent.Error.Message, code: response.statusCode });
102+
if (bodyContent.error.message) {
103+
reject({ message: bodyContent.error.message, code: bodyContent.error.code });
104+
} else {
105+
reject({ message: bodyContent.error, code: response.statusCode });
106+
}
107+
} else {
108+
if (bodyContent.message) {
109+
reject({ message: bodyContent.message, code: bodyContent.code });
110+
} else {
111+
reject({ message: bodyContent, code: response.statusCode });
112+
}
105113
}
106114
} catch (error) {
107115
reject({ message: "Error while parse server error: " + error });

src/package_version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@
2525
/**
2626
* Package version
2727
*/
28-
export const PackageVersion: string = "21.4.0";
28+
export const PackageVersion: string = "21.4.1";

src/serializer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export class Serializer {
132132
}
133133

134134
private static findCorrectType(data: any, expectedType: string) {
135-
if (data === undefined) {
135+
if (data === undefined || data === null) {
136136
return expectedType;
137137
} else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
138138
return expectedType;

test/api/test_conversion_api.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,15 @@ describe("test_conversion_api", () => {
5757
});
5858
});
5959

60+
it("test_get_info_returns_file_not_found", async () => {
61+
try {
62+
let response = await TestContext.getInfoApi().getDocumentMetadata(new GetDocumentMetadataRequest(TestFile.NotExist.GetPath()));
63+
expect(response.pageCount).equal(1);
64+
} catch (error) {
65+
expect(error.message).to.be.a('string').and.satisfy((msg: string) => msg.startsWith('AmazonS3 Storage exception: The specified key does not exist.'));
66+
}
67+
});
68+
6069
describe("test_get_supported_conversion_types", () => {
6170

6271
it("should return list of supported formats", () => {

0 commit comments

Comments
 (0)