1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.PublishError = void 0;
|
4 | /**
|
5 | * Exception to be thrown during failed ordered publish.
|
6 | *
|
7 | * @class
|
8 | * @extends Error
|
9 | */
|
10 | class PublishError extends Error {
|
11 | constructor(key, err) {
|
12 | super(`Unable to publish for key "${key}". Reason: ${err.message}`);
|
13 | /**
|
14 | * The gRPC grpc.status code.
|
15 | *
|
16 | * @name PublishError#code
|
17 | * @type {number}
|
18 | */
|
19 | this.code = err.code;
|
20 | /**
|
21 | * The gRPC grpc.status details.
|
22 | *
|
23 | * @name PublishError#details
|
24 | * @type {string}
|
25 | */
|
26 | this.details = err.details;
|
27 | /**
|
28 | * The gRPC grpc.Metadata object.
|
29 | *
|
30 | * @name PublishError#grpc.Metadata
|
31 | * @type {object}
|
32 | */
|
33 | this.metadata = err.metadata;
|
34 | /**
|
35 | * The ordering key this failure occurred for.
|
36 | *
|
37 | * @name PublishError#orderingKey
|
38 | * @type {string}
|
39 | */
|
40 | this.orderingKey = key;
|
41 | /**
|
42 | * The original gRPC error.
|
43 | *
|
44 | * @name PublishError#error
|
45 | * @type {Error}
|
46 | */
|
47 | this.error = err;
|
48 | }
|
49 | }
|
50 | exports.PublishError = PublishError;
|
51 | //# sourceMappingURL=publish-error.js.map |
\ | No newline at end of file |