Add Cursor error type
This commit is contained in:
parent
300a538314
commit
4f1847efa8
12
src/lib/painter/errors.ts
Normal file
12
src/lib/painter/errors.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
export class PaintCursorError extends Error {
|
||||||
|
cursorX
|
||||||
|
cursorY
|
||||||
|
|
||||||
|
constructor(message: string, {x, y}: {x: unknown, y: unknown}) {
|
||||||
|
super(message)
|
||||||
|
|
||||||
|
this.name = this.constructor.name
|
||||||
|
this.cursorX = !x ? 'No data' : x
|
||||||
|
this.cursorY = !y ? 'No data' : y
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user