@cumulus/errors 18.3.4 → 18.3.5

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.
package/dist/index.d.ts CHANGED
@@ -24,9 +24,6 @@ export declare class ThrottlingException extends Error {
24
24
  export interface ErrorWithOptionalCode extends Error {
25
25
  code?: string;
26
26
  }
27
- export interface ErrorWithName extends Error {
28
- name: string;
29
- }
30
27
  /**
31
28
  * Test to see if a given exception is an AWS Throttling Exception
32
29
  */
@@ -38,7 +35,7 @@ export declare const isWorkflowError: (error: Error) => boolean;
38
35
  /**
39
36
  * Returns true if the error is a DynamoDB conditional check exception.
40
37
  */
41
- export declare const isConditionalCheckException: (error: ErrorWithName) => boolean;
38
+ export declare const isConditionalCheckException: (error: ErrorWithOptionalCode) => boolean;
42
39
  /**
43
40
  * WorkflowError should be bubbled out to the overall workflow in the 'exception' field, rather than
44
41
  * being thrown and causting an immediate failure
package/dist/index.js CHANGED
@@ -28,7 +28,7 @@ exports.ThrottlingException = ThrottlingException;
28
28
  /**
29
29
  * Test to see if a given exception is an AWS Throttling Exception
30
30
  */
31
- const isThrottlingException = (err) => err.code === 'ThrottlingException';
31
+ const isThrottlingException = (err) => err.name === 'ThrottlingException' || err.code === 'ThrottlingException';
32
32
  exports.isThrottlingException = isThrottlingException;
33
33
  /**
34
34
  * Returns true if the error is a resource error.
@@ -38,7 +38,7 @@ exports.isWorkflowError = isWorkflowError;
38
38
  /**
39
39
  * Returns true if the error is a DynamoDB conditional check exception.
40
40
  */
41
- const isConditionalCheckException = (error) => error.name === 'ConditionalCheckFailedException';
41
+ const isConditionalCheckException = (error) => error.name === 'ConditionalCheckFailedException' || error.code === 'ConditionalCheckFailedException';
42
42
  exports.isConditionalCheckException = isConditionalCheckException;
43
43
  /**
44
44
  * WorkflowError should be bubbled out to the overall workflow in the 'exception' field, rather than
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cumulus/errors",
3
- "version": "18.3.4",
3
+ "version": "18.3.5",
4
4
  "description": "Provides error classes for Cumulus",
5
5
  "keywords": [
6
6
  "GIBS",
@@ -32,5 +32,5 @@
32
32
  },
33
33
  "author": "Cumulus Authors",
34
34
  "license": "Apache-2.0",
35
- "gitHead": "d2ddab76522b140fd7b92d865a8e0ec5d80485c7"
35
+ "gitHead": "04ba7f9aa1f20af96594f537e4c941b3f5d23ccc"
36
36
  }