diff --git a/src/lib/painter/errors.ts b/src/lib/painter/errors.ts new file mode 100644 index 0000000..c99fa8d --- /dev/null +++ b/src/lib/painter/errors.ts @@ -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 + } +}