set this.name property

This commit is contained in:
Nebel 2019-10-18 21:45:56 +09:00
parent b13125daec
commit 7f66c4ba38

View file

@ -76,7 +76,12 @@ export interface I2CSlaveDevice {
write16(registerNumber: number, value: number): Promise<number>;
}
export class OperationError extends Error {}
export class OperationError extends Error {
constructor(message: string) {
super(message);
this.name = this.constructor.name;
}
}
export async function requestI2CAccess(): Promise<I2CAccess> {
const ports = new I2CPortMap(