Skip to content

Commit 3b0c9d7

Browse files
committed
fix(scheduler-utils): do not set name in error constructor to prevent breaking change
1 parent d25a35e commit 3b0c9d7

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

scheduler-utils/README.md

-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ import { locate, TransactionNotFoundError } from "@permaweb/ao-scheduler-utils";
133133
await locate('<process-id>')
134134
.catch((err) => {
135135
if (err instanceof TransactionNotFoundError) // using instanceof
136-
if (err.name === TransactionNotFoundError.name) // use static name on constructor
137136
if (err.name === 'TransactionNotFound') // use a static string
138137

139138
throw err // bubble unknown error

scheduler-utils/src/err.js

-15
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,11 @@
11
export class InvalidSchedulerLocationError extends Error {
22
name = 'InvalidSchedulerLocation'
3-
4-
constructor (...args) {
5-
super(...args)
6-
this.name = InvalidSchedulerLocationError.name
7-
}
83
}
94

105
export class SchedulerTagNotFoundError extends Error {
116
name = 'SchedulerTagNotFound'
12-
13-
constructor (...args) {
14-
super(...args)
15-
this.name = SchedulerTagNotFoundError.name
16-
}
177
}
188

199
export class TransactionNotFoundError extends Error {
2010
name = 'TransactionNotFound'
21-
22-
constructor (...args) {
23-
super(...args)
24-
this.name = TransactionNotFoundError.name
25-
}
2611
}

0 commit comments

Comments
 (0)