set this.name property

This commit is contained in:
Nebel 2019-10-18 21:24:18 +09:00
parent 1eca0efb67
commit 832143b725

View file

@ -225,9 +225,21 @@ export class GPIOPort extends EventEmitter {
} }
} }
export class InvalidAccessError extends Error {} export class InvalidAccessError extends Error {
constructor(message: string) {
super(message);
export class OperationError extends Error {} this.name = this.constructor.name;
}
}
export class OperationError extends Error {
constructor(message: string) {
super(message);
this.name = this.constructor.name;
}
}
export async function requestGPIOAccess(): Promise<GPIOAccess> { export async function requestGPIOAccess(): Promise<GPIOAccess> {
const ports = new GPIOPortMap( const ports = new GPIOPortMap(