@zudojs/errors 1.3.0 → 1.3.1

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.
@@ -22,11 +22,17 @@ export declare class InvalidMessageError extends MessageError {
22
22
  export declare class MessageTypeNotFoundError extends MessageError {
23
23
  constructor(messageType: string);
24
24
  }
25
- /** Error thrown when message dispatch is aborted. */
25
+ /**
26
+ * Error thrown when message dispatch is aborted.
27
+ *
28
+ * `options.cause` is the abort signal's `reason`, so the caller's reason
29
+ * for cancelling survives as `error.cause`.
30
+ */
26
31
  export declare class MessageDispatchAbortedError extends MessageError {
27
32
  constructor(message?: string, options?: {
28
33
  messageType?: string;
29
34
  messageId?: string;
35
+ cause?: unknown;
30
36
  });
31
37
  }
32
38
  /** Error thrown when the message bus has been disposed. */
@@ -43,13 +43,19 @@ export class MessageTypeNotFoundError extends MessageError {
43
43
  });
44
44
  }
45
45
  }
46
- /** Error thrown when message dispatch is aborted. */
46
+ /**
47
+ * Error thrown when message dispatch is aborted.
48
+ *
49
+ * `options.cause` is the abort signal's `reason`, so the caller's reason
50
+ * for cancelling survives as `error.cause`.
51
+ */
47
52
  export class MessageDispatchAbortedError extends MessageError {
48
53
  constructor(message = "Message dispatch was aborted.", options = {}) {
49
54
  super(message, {
50
55
  code: ErrorCode.MESSAGE_ABORTED,
51
56
  messageType: options.messageType,
52
57
  messageId: options.messageId,
58
+ cause: options.cause,
53
59
  statusCode: 499,
54
60
  expose: false,
55
61
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zudojs/errors",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Shared error base class, error codes, and error handling utilities for the Zudojs framework.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",