Add TypeScript integrations package
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
export class IntegrationError extends Error {
|
||||
constructor(
|
||||
messageArg: string,
|
||||
public readonly code: string,
|
||||
public readonly cause?: unknown
|
||||
) {
|
||||
super(messageArg);
|
||||
}
|
||||
}
|
||||
|
||||
export class DiscoveryError extends IntegrationError {
|
||||
constructor(messageArg: string, causeArg?: unknown) {
|
||||
super(messageArg, 'DISCOVERY_ERROR', causeArg);
|
||||
}
|
||||
}
|
||||
|
||||
export class AuthenticationError extends IntegrationError {
|
||||
constructor(messageArg: string, causeArg?: unknown) {
|
||||
super(messageArg, 'AUTHENTICATION_ERROR', causeArg);
|
||||
}
|
||||
}
|
||||
|
||||
export class DeviceCommunicationError extends IntegrationError {
|
||||
constructor(messageArg: string, causeArg?: unknown) {
|
||||
super(messageArg, 'DEVICE_COMMUNICATION_ERROR', causeArg);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user