@integromat/proto
Version:
Integromat Proto-Classes
267 lines • 7.52 kB
TypeScript
import { Bundle } from './types';
declare global {
interface Error {
name: string;
message: string;
stack?: string;
hash?: string;
bundle?: Bundle;
suberrors?: Error[];
external?: any;
/**
* @deprecated use hash instead
*/
imtExceptionHash?: string;
/**
* @deprecated use `cause` instead
*/
imtInternalError?: Error;
toJSON(): ErrorJSON;
}
}
export type ErrorJSON = {
name: string;
message: string;
stack?: string;
hash?: string;
/**
* @deprecated use hash instead
*/
imtExceptionHash?: string;
/**
* @deprecated do not use
*/
imtInternalError?: ErrorJSON;
bundle?: Bundle;
suberrors?: ErrorJSON[];
external?: unknown;
};
/**
* Unknown Error. Used when non-instanceof-error error happens in program logic.
*
* @param {*} err Original error.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class UnknownError extends Error {
constructor(err: Error | string);
toJSON(): ErrorJSON;
}
/**
* Runtime Error. Used when error happens in program logic, not in invalid data. Flow will be rolled back.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class RuntimeError extends Error {
constructor(message: string);
}
/**
* Data Error. Used on invalid data. Bundle will be moved to DLQ. Process flow will be commited normally.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class DataError extends Error {
constructor(message: string);
}
/**
* Inconsistency Error. Used when commit/rollback fails. Process flow stops immediately. Commited data remain commited.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class InconsistencyError extends Error {
constructor(message: string);
}
/**
* Rate Limit Error. Used when API rate limit is exceeded.
*
* **IMPORTANT**: Also freezes the scenario for some time.
*
* @param {String} message Error message.
* @param {Number} [delay] Delay in milliseconds. Optional, default is 20 minutes.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
* @property {Number} delay Delay in milliseconds.
*/
export declare class RateLimitError extends Error {
delay: number;
constructor(message: string, delay: number);
}
/**
* Out Of Space Error. Used when service reports out of space.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class OutOfSpaceError extends Error {
constructor(message: string);
}
/**
* Connection Error. Used when there is a problem with connection to the service.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class ConnectionError extends Error {
constructor(message: string);
}
/**
* Invalid Configuration Error. Used when configuration is broken and user interaction is required.
*
* **IMPORTANT**: Also disables the scenario.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class InvalidConfigurationError extends Error {
constructor(message: string);
}
/**
* Invalid Access Token Error. Used when service access token is expired or invalid.
*
* **IMPORTANT**: Also disables the scenario.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class InvalidAccessTokenError extends InvalidConfigurationError {
constructor(message: string);
}
/**
* Invalid Access Token Error. Used when unexpected things occurs.
*
* **IMPORTANT**: Also disables and lock the scenario. Staff revision is required in order to unlock the scenario.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class UnexpectedError extends Error {
constructor(message: string);
}
/**
* Max Results Exceeded Error. Used when limit of results was exceeded.
*
* **IMPORTANT**: Also disables the scenario.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class MaxResultsExceededError extends Error {
constructor(message: string);
}
/**
* Max File Size Exceeded Error. Used when limit of file size was exceeded.
*
* **IMPORTANT**: Also disables the scenario.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class MaxFileSizeExceededError extends Error {
constructor(message: string);
}
/**
* Incomplete Data Error. Used when received data are incomplete.
*
* @param {String} message Error message.
* @param {Number} [delay] Delay in milliseconds. Optional.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
* @property {Number} delay Delay in milliseconds.
*/
export declare class IncompleteDataError extends Error {
delay: number;
constructor(message: string, delay: number);
}
/**
* Duplicate Data Error. Used when service receives duplicate data.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class DuplicateDataError extends Error {
constructor(message: string);
}
/**
* Module Timeout Error. Used when service module operation exceeds time limit.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class ModuleTimeoutError extends Error {
constructor(message: string);
}
/**
* Scenario Timeout Error. Used when service scenario execution exceeds time limit.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class ScenarioTimeoutError extends Error {
constructor(message: string);
}
/**
* Used when processing of a scenario exceeds operations limit.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class OperationsLimitExceededError extends Error {
constructor(message: string);
}
/**
* Used when processing of a scenario exceeds data size limit.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class DataSizeLimitExceededError extends Error {
constructor(message: string);
}
/**
* Used when execution is interrupted.
*
* @param {String} message Error message.
*
* @property {String} stack Call stack.
* @property {String} message Error message.
*/
export declare class ExecutionInterruptedError extends Error {
constructor(message: string);
}
//# sourceMappingURL=error.d.ts.map