Skip to content

Commit a38dabd

Browse files
authored
split files (#19)
1 parent 6f2a9b3 commit a38dabd

File tree

3 files changed

+1235
-1192
lines changed

3 files changed

+1235
-1192
lines changed

src/error.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)