@cumulus/errors
Version:
Provides error classes for Cumulus
360 lines • 9.38 kB
TypeScript
/**
* A constructor function that returns an instance of Error (or something that inherits from Error).
* Typically, this is going to be a class, such as `Error`, `TypeError`, etc.
*/
declare type ErrorClass = new (message: string) => Error;
/**
* Creates a new error type with the given name and parent class. Sets up
* boilerplate necessary to successfully subclass Error and preserve stack trace
* @param name - The name of the error type
* @param ParentType - The error that serves as the parent
* @returns The new type
*/
export declare const createErrorType: (name: string, ParentType?: ErrorClass) => {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare class ThrottlingException extends Error {
readonly code: string;
constructor();
}
export interface ErrorWithOptionalCode extends Error {
code?: string;
}
/**
* Test to see if a given exception is a Throttling Exception.
*/
export declare const isThrottlingException: (err: ErrorWithOptionalCode) => boolean;
/**
* Returns true if the error is a resource error.
*/
export declare const isWorkflowError: (error: Error) => boolean;
/**
* Returns true if the error is a DynamoDB conditional check exception.
*/
export declare const isConditionalCheckException: (error: any) => boolean;
/**
* WorkflowError should be bubbled out to the overall workflow in the 'exception' field, rather than
* being thrown and causting an immediate failure
*/
export declare const WorkflowError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* NotNeededError indicates that execution was not completed because it was unnecessary. The
* workflow should therefore terminate but be considered successful
*/
export declare const NotNeededError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* IncompleteError indicates that the execution was partially successful and can be re-executed to
* make further progress. This may happen, for instance, if an execution timeout stops progress
*/
export declare const IncompleteError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* ResourcesLockedError indicates that the execution is unable to proceed due to resources being
* tied up in other executions. Execution may be retried after resources free up
*/
export declare const ResourcesLockedError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* RemoteResourceError indicates that a required remote resource could not be fetched or otherwise
* used
*/
export declare const RemoteResourceError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* The error object for when the xml file path is not provided
*/
export declare const XmlMetaFileNotFound: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* No CMR metadata file was present.
*/
export declare const CMRMetaFileNotFound: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* CMR returned an internal server error
*/
export declare const CMRInternalError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* Distribution bucket map is missing a configured value for a distribution bucket
*/
export declare const MissingBucketMap: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* The provider info is missing error
*/
export declare const ApiCollisionError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const ConnectionTimeout: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const CumulusMessageError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const DeletePublishedGranule: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const DuplicateFile: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const EcsStartTaskError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const FileNotFound: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const FTPError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const GranuleNotPublished: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const GranuleFileWriteError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const HostNotFound: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const InvalidArgument: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const InvalidChecksum: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const InvalidRegexError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const MismatchPdrCollection: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const MissingRequiredArgument: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const MissingRequiredEnvVar: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const MissingRequiredEnvVarError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const MissingS3FileError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const PDRParsingError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const ProviderNotFound: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const RecordAlreadyMigrated: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const RecordDoesNotExist: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const UnexpectedFileSize: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const UnmatchedRegexError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const UnparsableFileLocationError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const ValidationError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare class PostgresValidationError extends ValidationError {
detail: string | undefined;
constructor(message: string);
}
export declare const PostgresUpdateFailed: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const IndexExistsError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
export declare const UnmetRequirementsError: {
new (message: string): {
name: string;
message: string;
stack?: string | undefined;
};
};
/**
* Safely serializes an error-like object to JSON, removing circular references
* and including only own properties.
*
* @param err - The error or object to serialize
* @returns A JSON string representation of the object
*/
export declare const errorify: (err: any) => string;
export {};
//# sourceMappingURL=index.d.ts.map