Skip to content

Commit 6ea3549

Browse files
committed
Refactor errors into separate file
1 parent 97c1950 commit 6ea3549

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

source/error.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/**
2+
* lazy-linked-lists
3+
* Lazy and infinite linked lists for JavaScript.
4+
*
5+
* source/error.js
6+
*
7+
* Errors.
8+
* @license ISC
9+
*/
10+
11+
export class EmptyListError extends Error {
12+
constructor(message) {
13+
super(message);
14+
this.name = 'EmptyListError';
15+
}
16+
}
17+
export class OutOfRangeError extends Error {
18+
constructor(message) {
19+
super(message);
20+
this.name = 'OutOfRangeError';
21+
}
22+
}

0 commit comments

Comments
 (0)