Review funkt

This commit is contained in:
2026-08-09 21:56:00 +00:00
parent f522ae9953
commit fe9dfa4519
11366 changed files with 2335077 additions and 97 deletions

View File

@@ -0,0 +1,20 @@
/**
* Error message used when a connection is closed.
*
* This mirrors the constant exported by ioredis (`ioredis/built/utils`) but is
* defined locally so that BullMQ can be used without ioredis installed (for
* example, when using the PostgreSQL backend).
*/
export declare const CONNECTION_CLOSED_ERROR_MSG = "Connection is closed.";
/**
* Thrown by any BullMQ Redis adapter (ioredis, node-redis, Bun, …) when a
* command fails because the connection is already closed or was closed
* mid-flight.
*
* Using a single well-known class lets {@link isNotConnectionError} do a
* structural `instanceof` check rather than fragile message-substring matching.
*/
export declare class ConnectionClosedError extends Error {
readonly cause?: unknown;
constructor(message?: string, cause?: unknown);
}

View File

@@ -0,0 +1,24 @@
/**
* Error message used when a connection is closed.
*
* This mirrors the constant exported by ioredis (`ioredis/built/utils`) but is
* defined locally so that BullMQ can be used without ioredis installed (for
* example, when using the PostgreSQL backend).
*/
export const CONNECTION_CLOSED_ERROR_MSG = 'Connection is closed.';
/**
* Thrown by any BullMQ Redis adapter (ioredis, node-redis, Bun, …) when a
* command fails because the connection is already closed or was closed
* mid-flight.
*
* Using a single well-known class lets {@link isNotConnectionError} do a
* structural `instanceof` check rather than fragile message-substring matching.
*/
export class ConnectionClosedError extends Error {
constructor(message, cause) {
super(message !== null && message !== void 0 ? message : CONNECTION_CLOSED_ERROR_MSG);
this.cause = cause;
this.name = 'ConnectionClosedError';
Object.setPrototypeOf(this, new.target.prototype);
}
}

View File

@@ -0,0 +1,11 @@
export declare const DELAYED_ERROR = "bullmq:movedToDelayed";
/**
* DelayedError
*
* Error to be thrown when job is moved to delayed state
* from job in active state.
*
*/
export declare class DelayedError extends Error {
constructor(message?: string);
}

View File

@@ -0,0 +1,15 @@
export const DELAYED_ERROR = 'bullmq:movedToDelayed';
/**
* DelayedError
*
* Error to be thrown when job is moved to delayed state
* from job in active state.
*
*/
export class DelayedError extends Error {
constructor(message = DELAYED_ERROR) {
super(message);
this.name = this.constructor.name;
Object.setPrototypeOf(this, new.target.prototype);
}
}

View File

@@ -0,0 +1,6 @@
export * from './connection-closed-error';
export * from './delayed-error';
export * from './rate-limit-error';
export * from './unrecoverable-error';
export * from './waiting-children-error';
export * from './waiting-error';

6
node_modules/bullmq/dist/esm/classes/errors/index.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
export * from './connection-closed-error';
export * from './delayed-error';
export * from './rate-limit-error';
export * from './unrecoverable-error';
export * from './waiting-children-error';
export * from './waiting-error';

View File

@@ -0,0 +1,10 @@
export declare const RATE_LIMIT_ERROR = "bullmq:rateLimitExceeded";
/**
* RateLimitError
*
* Error to be thrown when queue reaches a rate limit.
*
*/
export declare class RateLimitError extends Error {
constructor(message?: string);
}

View File

@@ -0,0 +1,14 @@
export const RATE_LIMIT_ERROR = 'bullmq:rateLimitExceeded';
/**
* RateLimitError
*
* Error to be thrown when queue reaches a rate limit.
*
*/
export class RateLimitError extends Error {
constructor(message = RATE_LIMIT_ERROR) {
super(message);
this.name = this.constructor.name;
Object.setPrototypeOf(this, new.target.prototype);
}
}

View File

@@ -0,0 +1,11 @@
export declare const UNRECOVERABLE_ERROR = "bullmq:unrecoverable";
/**
* UnrecoverableError
*
* Error to move a job to failed even if the attemptsMade
* are lower than the expected limit.
*
*/
export declare class UnrecoverableError extends Error {
constructor(message?: string);
}

View File

@@ -0,0 +1,15 @@
export const UNRECOVERABLE_ERROR = 'bullmq:unrecoverable';
/**
* UnrecoverableError
*
* Error to move a job to failed even if the attemptsMade
* are lower than the expected limit.
*
*/
export class UnrecoverableError extends Error {
constructor(message = UNRECOVERABLE_ERROR) {
super(message);
this.name = this.constructor.name;
Object.setPrototypeOf(this, new.target.prototype);
}
}

View File

@@ -0,0 +1,11 @@
export declare const WAITING_CHILDREN_ERROR = "bullmq:movedToWaitingChildren";
/**
* WaitingChildrenError
*
* Error to be thrown when job is moved to waiting-children state
* from job in active state.
*
*/
export declare class WaitingChildrenError extends Error {
constructor(message?: string);
}

View File

@@ -0,0 +1,15 @@
export const WAITING_CHILDREN_ERROR = 'bullmq:movedToWaitingChildren';
/**
* WaitingChildrenError
*
* Error to be thrown when job is moved to waiting-children state
* from job in active state.
*
*/
export class WaitingChildrenError extends Error {
constructor(message = WAITING_CHILDREN_ERROR) {
super(message);
this.name = this.constructor.name;
Object.setPrototypeOf(this, new.target.prototype);
}
}

View File

@@ -0,0 +1,10 @@
export declare const WAITING_ERROR = "bullmq:movedToWait";
/**
* WaitingError
*
* Error to be thrown when job is moved to wait or prioritized state
* from job in active state.
*/
export declare class WaitingError extends Error {
constructor(message?: string);
}

View File

@@ -0,0 +1,14 @@
export const WAITING_ERROR = 'bullmq:movedToWait';
/**
* WaitingError
*
* Error to be thrown when job is moved to wait or prioritized state
* from job in active state.
*/
export class WaitingError extends Error {
constructor(message = WAITING_ERROR) {
super(message);
this.name = this.constructor.name;
Object.setPrototypeOf(this, new.target.prototype);
}
}