+17
-5
packages/identity/did-plc/lib/errors.ts
+17
-5
packages/identity/did-plc/lib/errors.ts
···
7
7
export class ImproperOperationError extends PlcError {
8
8
override name = 'ImproperOperationError';
9
9
10
-
constructor(operation: t.IndexedEntry, reason: string) {
10
+
constructor(
11
+
public operation: t.IndexedEntry,
12
+
public reason: string,
13
+
) {
11
14
super(`improper operation; cid=${operation.cid}; reason=${reason}`);
12
15
}
13
16
}
···
15
18
export class InvalidSignatureError extends PlcError {
16
19
override name = 'InvalidSignatureError';
17
20
18
-
constructor(operation: t.IndexedEntry) {
21
+
constructor(public operation: t.IndexedEntry) {
19
22
super(`invalid signature; cid=${operation.cid}`);
20
23
}
21
24
}
···
23
26
export class InvalidHashError extends PlcError {
24
27
override name = 'InvalidHashError';
25
28
26
-
constructor(operation: t.IndexedEntry, expected: string) {
29
+
constructor(
30
+
public operation: t.IndexedEntry,
31
+
public expected: string,
32
+
) {
27
33
super(`invalid hash; expected=${expected}; got=${operation.cid}`);
28
34
}
29
35
}
···
31
37
export class GenesisHashError extends PlcError {
32
38
override name = 'GenesisHashError';
33
39
34
-
constructor(operation: t.IndexedEntry, did: t.DidPlcString) {
40
+
constructor(
41
+
public operation: t.IndexedEntry,
42
+
public did: t.DidPlcString,
43
+
) {
35
44
super(`mismatching genesis hash; did=${did}; cid=${operation.cid}`);
36
45
}
37
46
}
···
39
48
export class LateDisputeError extends PlcError {
40
49
override name = 'LateDisputeError';
41
50
42
-
constructor(operation: t.IndexedEntry, lapsed: number) {
51
+
constructor(
52
+
public operation: t.IndexedEntry,
53
+
public lapsed: number,
54
+
) {
43
55
super(`dispute occured outside of permitted window; cid=${operation.cid}; lapsed=${lapsed}`);
44
56
}
45
57
}