smartling-api-sdk-nodejs 1.2.2 → 1.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,5 +2,5 @@ projectKey=smartling-api-sdk-nodejs
2
2
  serverUrl=https://sonar-next.connectors.stg.smartling.net
3
3
  serverVersion=8.6.1.40680
4
4
  dashboardUrl=https://sonar-next.connectors.stg.smartling.net/dashboard?id=smartling-api-sdk-nodejs
5
- ceTaskId=AX5U6aJEEoKIQwCSYHJh
6
- ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AX5U6aJEEoKIQwCSYHJh
5
+ ceTaskId=AX6wovwBEoKIQwCSYHKz
6
+ ceTaskUrl=https://sonar-next.connectors.stg.smartling.net/api/ce/task?id=AX6wovwBEoKIQwCSYHKz
@@ -7,6 +7,14 @@ class SmartlingException extends Error {
7
7
  this.payload = payload;
8
8
  this.nestedException = e;
9
9
  }
10
+
11
+ public getPayload(): Record<string, unknown> {
12
+ return this.payload;
13
+ }
14
+
15
+ public getNestedException(): Error {
16
+ return this.nestedException;
17
+ }
10
18
  }
11
19
 
12
20
  SmartlingException.prototype.toString = function smartlingExceptionToString() {
@@ -2,5 +2,7 @@ declare class SmartlingException extends Error {
2
2
  protected payload: Record<string, unknown>;
3
3
  protected nestedException: Error;
4
4
  constructor(message: string, payload?: Record<string, unknown>, e?: Error);
5
+ getPayload(): Record<string, unknown>;
6
+ getNestedException(): Error;
5
7
  }
6
8
  export { SmartlingException };
@@ -7,6 +7,12 @@ class SmartlingException extends Error {
7
7
  this.payload = payload;
8
8
  this.nestedException = e;
9
9
  }
10
+ getPayload() {
11
+ return this.payload;
12
+ }
13
+ getNestedException() {
14
+ return this.nestedException;
15
+ }
10
16
  }
11
17
  exports.SmartlingException = SmartlingException;
12
18
  SmartlingException.prototype.toString = function smartlingExceptionToString() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/exception/index.ts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CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AAClJ,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartling-api-sdk-nodejs",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Package for Smartling API",
5
5
  "main": "built/index.js",
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smartling-api-sdk-nodejs",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "Package for Smartling API",
5
5
  "main": "built/index.js",
6
6
  "scripts": {
@@ -10,5 +10,8 @@ describe("Exception base class tests.", () => {
10
10
 
11
11
  assert.equal(result.includes("Test root exception, payload={\"root\":\"value\"}, stack=Error: Test root exception"), true);
12
12
  assert.equal(result.includes("Test nested exception, payload={\"foo\":\"nested\"}, stack=Error: Test nested exception"), true);
13
+ assert.deepEqual(rootException.getPayload(), { root: "value" });
14
+ assert.deepEqual(rootException.getNestedException(), nestedException);
15
+ assert.deepEqual((rootException.getNestedException() as SmartlingException).getPayload(), { foo: "nested" });
13
16
  });
14
17
  });