@cumulus/errors
Advanced tools
Comparing version 9.7.0 to 9.8.0
@@ -11,3 +11,3 @@ "use strict"; | ||
*/ | ||
exports.createErrorType = (name, ParentType = Error) => (class extends ParentType { | ||
const createErrorType = (name, ParentType = Error) => (class extends ParentType { | ||
constructor(message) { | ||
@@ -19,2 +19,3 @@ super(message); | ||
}); | ||
exports.createErrorType = createErrorType; | ||
class ThrottlingException extends Error { | ||
@@ -32,11 +33,14 @@ constructor() { | ||
*/ | ||
exports.isThrottlingException = (err) => err.code === 'ThrottlingException'; | ||
const isThrottlingException = (err) => err.code === 'ThrottlingException'; | ||
exports.isThrottlingException = isThrottlingException; | ||
/** | ||
* Returns true if the error is a resource error. | ||
*/ | ||
exports.isWorkflowError = (error) => error.name.includes('WorkflowError'); | ||
const isWorkflowError = (error) => error.name.includes('WorkflowError'); | ||
exports.isWorkflowError = isWorkflowError; | ||
/** | ||
* Returns true if the error is a DynamoDB conditional check exception. | ||
*/ | ||
exports.isConditionalCheckException = (error) => error.code === 'ConditionalCheckFailedException'; | ||
const isConditionalCheckException = (error) => error.code === 'ConditionalCheckFailedException'; | ||
exports.isConditionalCheckException = isConditionalCheckException; | ||
/** | ||
@@ -46,3 +50,3 @@ * WorkflowError should be bubbled out to the overall workflow in the 'exception' field, rather than | ||
*/ | ||
exports.WorkflowError = exports.createErrorType('WorkflowError'); | ||
exports.WorkflowError = (0, exports.createErrorType)('WorkflowError'); | ||
/** | ||
@@ -52,3 +56,3 @@ * NotNeededError indicates that execution was not completed because it was unnecessary. The | ||
*/ | ||
exports.NotNeededError = exports.createErrorType('NotNeededWorkflowError', exports.WorkflowError); | ||
exports.NotNeededError = (0, exports.createErrorType)('NotNeededWorkflowError', exports.WorkflowError); | ||
/** | ||
@@ -58,3 +62,3 @@ * IncompleteError indicates that the execution was partially successful and can be re-executed to | ||
*/ | ||
exports.IncompleteError = exports.createErrorType('IncompleteWorkflowError', exports.WorkflowError); | ||
exports.IncompleteError = (0, exports.createErrorType)('IncompleteWorkflowError', exports.WorkflowError); | ||
/** | ||
@@ -64,3 +68,3 @@ * ResourcesLockedError indicates that the execution is unable to proceed due to resources being | ||
*/ | ||
exports.ResourcesLockedError = exports.createErrorType('ResourcesLockedWorkflowError', exports.WorkflowError); | ||
exports.ResourcesLockedError = (0, exports.createErrorType)('ResourcesLockedWorkflowError', exports.WorkflowError); | ||
/** | ||
@@ -70,46 +74,46 @@ * RemoteResourceError indicates that a required remote resource could not be fetched or otherwise | ||
*/ | ||
exports.RemoteResourceError = exports.createErrorType('RemoteResourceError'); | ||
exports.RemoteResourceError = (0, exports.createErrorType)('RemoteResourceError'); | ||
/** | ||
* The error object for when the xml file path is not provided | ||
*/ | ||
exports.XmlMetaFileNotFound = exports.createErrorType('XmlMetaFileNotFound'); | ||
exports.XmlMetaFileNotFound = (0, exports.createErrorType)('XmlMetaFileNotFound'); | ||
/** | ||
* No CMR metadata file was present. | ||
*/ | ||
exports.CMRMetaFileNotFound = exports.createErrorType('CMRMetaFileNotFound'); | ||
exports.CMRMetaFileNotFound = (0, exports.createErrorType)('CMRMetaFileNotFound'); | ||
/** | ||
* CMR returned an internal server error | ||
*/ | ||
exports.CMRInternalError = exports.createErrorType('CMRInternalError'); | ||
exports.CMRInternalError = (0, exports.createErrorType)('CMRInternalError'); | ||
/** | ||
* Distribution bucket map is missing a configured value for a distribution bucket | ||
*/ | ||
exports.MissingBucketMap = exports.createErrorType('MissingBucketMap'); | ||
exports.MissingBucketMap = (0, exports.createErrorType)('MissingBucketMap'); | ||
/** | ||
* The provider info is missing error | ||
*/ | ||
exports.ProviderNotFound = exports.createErrorType('ProviderNotFound'); | ||
exports.ConnectionTimeout = exports.createErrorType('ConnectionTimeout'); | ||
exports.CumulusMessageError = exports.createErrorType('CumulusMessageError'); | ||
exports.DeletePublishedGranule = exports.createErrorType('DeletePublishedGranule'); | ||
exports.DuplicateFile = exports.createErrorType('DuplicateFile'); | ||
exports.EcsStartTaskError = exports.createErrorType('EcsStartTaskError'); | ||
exports.FileNotFound = exports.createErrorType('FileNotFound'); | ||
exports.FTPError = exports.createErrorType('FTPError'); | ||
exports.ApiCollisionError = exports.createErrorType('ApiCollisionError'); | ||
exports.HostNotFound = exports.createErrorType('HostNotFound'); | ||
exports.InvalidArgument = exports.createErrorType('InvalidArgument'); | ||
exports.InvalidChecksum = exports.createErrorType('InvalidChecksum'); | ||
exports.InvalidRegexError = exports.createErrorType('InvalidRegexError'); | ||
exports.MismatchPdrCollection = exports.createErrorType('MismatchPdrCollection'); | ||
exports.MissingRequiredEnvVar = exports.createErrorType('MissingRequiredEnvVar'); | ||
exports.PDRParsingError = exports.createErrorType('PDRParsingError'); | ||
exports.RecordDoesNotExist = exports.createErrorType('RecordDoesNotExist'); | ||
exports.UnexpectedFileSize = exports.createErrorType('UnexpectedFileSize'); | ||
exports.UnmatchedRegexError = exports.createErrorType('UnmatchedRegexError'); | ||
exports.UnparsableFileLocationError = exports.createErrorType('UnparsableFileLocationError'); | ||
exports.ValidationError = exports.createErrorType('ValidationError'); | ||
exports.MissingRequiredEnvVarError = exports.createErrorType('MissingRequiredEnvVarError'); | ||
exports.RecordAlreadyMigrated = exports.createErrorType('RecordAlreadyMigrated'); | ||
exports.GranuleNotPublished = exports.createErrorType('GranuleNotPublished'); | ||
exports.ProviderNotFound = (0, exports.createErrorType)('ProviderNotFound'); | ||
exports.ConnectionTimeout = (0, exports.createErrorType)('ConnectionTimeout'); | ||
exports.CumulusMessageError = (0, exports.createErrorType)('CumulusMessageError'); | ||
exports.DeletePublishedGranule = (0, exports.createErrorType)('DeletePublishedGranule'); | ||
exports.DuplicateFile = (0, exports.createErrorType)('DuplicateFile'); | ||
exports.EcsStartTaskError = (0, exports.createErrorType)('EcsStartTaskError'); | ||
exports.FileNotFound = (0, exports.createErrorType)('FileNotFound'); | ||
exports.FTPError = (0, exports.createErrorType)('FTPError'); | ||
exports.ApiCollisionError = (0, exports.createErrorType)('ApiCollisionError'); | ||
exports.HostNotFound = (0, exports.createErrorType)('HostNotFound'); | ||
exports.InvalidArgument = (0, exports.createErrorType)('InvalidArgument'); | ||
exports.InvalidChecksum = (0, exports.createErrorType)('InvalidChecksum'); | ||
exports.InvalidRegexError = (0, exports.createErrorType)('InvalidRegexError'); | ||
exports.MismatchPdrCollection = (0, exports.createErrorType)('MismatchPdrCollection'); | ||
exports.MissingRequiredEnvVar = (0, exports.createErrorType)('MissingRequiredEnvVar'); | ||
exports.PDRParsingError = (0, exports.createErrorType)('PDRParsingError'); | ||
exports.RecordDoesNotExist = (0, exports.createErrorType)('RecordDoesNotExist'); | ||
exports.UnexpectedFileSize = (0, exports.createErrorType)('UnexpectedFileSize'); | ||
exports.UnmatchedRegexError = (0, exports.createErrorType)('UnmatchedRegexError'); | ||
exports.UnparsableFileLocationError = (0, exports.createErrorType)('UnparsableFileLocationError'); | ||
exports.ValidationError = (0, exports.createErrorType)('ValidationError'); | ||
exports.MissingRequiredEnvVarError = (0, exports.createErrorType)('MissingRequiredEnvVarError'); | ||
exports.RecordAlreadyMigrated = (0, exports.createErrorType)('RecordAlreadyMigrated'); | ||
exports.GranuleNotPublished = (0, exports.createErrorType)('GranuleNotPublished'); | ||
class PostgresValidationError extends exports.ValidationError { | ||
@@ -123,4 +127,4 @@ constructor(message) { | ||
exports.PostgresValidationError = PostgresValidationError; | ||
exports.PostgresUpdateFailed = exports.createErrorType('PostgresUpdateFailed'); | ||
exports.IndexExistsError = exports.createErrorType('IndexExistsError'); | ||
exports.PostgresUpdateFailed = (0, exports.createErrorType)('PostgresUpdateFailed'); | ||
exports.IndexExistsError = (0, exports.createErrorType)('IndexExistsError'); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@cumulus/errors", | ||
"version": "9.7.0", | ||
"version": "9.8.0", | ||
"description": "Provides error classes for Cumulus", | ||
@@ -35,3 +35,3 @@ "keywords": [ | ||
"license": "Apache-2.0", | ||
"gitHead": "08fb2c1d9113e7be465316f950d4ac9272bd3141" | ||
"gitHead": "913034ba6814e562b7f3d58bb39cf086255a6efd" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26675
447