-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: move usb errors inside model folder
- Loading branch information
1 parent
de3266a
commit c9226d3
Showing
4 changed files
with
69 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
export type PromptDeviceAccessError = | ||
| UsbHidTransportNotSupportedError | ||
| NoAccessibleDeviceError; | ||
|
||
export type ConnectError = UnknownDeviceError | OpeningConnectionError; | ||
|
||
export type exchangeApduError = UnconnectedDeviceError | SendingApduError; | ||
|
||
export class DeviceNotRecognizedError { | ||
readonly _tag = "DeviceNotRecognizedError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} | ||
|
||
export class NoAccessibleDeviceError { | ||
readonly _tag = "NoAccessibleDeviceError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} | ||
|
||
export class OpeningConnectionError { | ||
readonly _tag = "ConnectionOpeningError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} | ||
|
||
export class SendingApduError { | ||
readonly _tag = "SendingApduError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} | ||
|
||
export class UnconnectedDeviceError { | ||
readonly _tag = "UnconnectedDeviceError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} | ||
|
||
export class UnknownDeviceError { | ||
readonly _tag = "UnknownDeviceError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} | ||
|
||
export class UsbHidTransportNotSupportedError { | ||
readonly _tag = "UsbHidTransportNotSupportedError"; | ||
originalError?: Error; | ||
constructor(readonly err?: Error) { | ||
this.originalError = err; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters