We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f2a9b3 commit a38dabdCopy full SHA for a38dabd
src/error.ts
@@ -0,0 +1,24 @@
1
+/** an error that results from a failed request */
2
+export class ValidationError extends Error {
3
+ /** the response status number */
4
+ readonly field: string;
5
+ /** the response status text */
6
+ readonly regex: RegExp;
7
+
8
+ constructor(field: string, regex: RegExp, message: string) {
9
+ super(message);
10
+ this.field = field;
11
+ this.regex = regex;
12
+ }
13
+}
14
15
+/** an error that results while supplying a hash not found in the entries of the root hash */
16
+export class HashNotFoundError extends Error {
17
+ /** the hash that couldn't be found */
18
+ readonly hash: string;
19
20
+ constructor(hash: string) {
21
+ super(`'${hash}' not found in the root hash`);
22
+ this.hash = hash;
23
24
0 commit comments