Files
orca/src/shared/remote-runtime/remote-runtime-client-error.ts
T

28 lines
873 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
export type RemoteRuntimePairingStage = 'connect' | 'host-identity' | 'access-grant' | 'runtime'
/** Separate error type from ws/tweetnacl imports: mobile’s transitive type graph has no Node-only dependencies installed. */
export class RemoteRuntimeClientError extends Error {
readonly code: string
/** Structured recovery data must survive the WebSocket adapter unchanged. */
readonly data?: unknown
readonly pairingStage?: RemoteRuntimePairingStage
readonly closeCode?: number
constructor(
code: string,
message: string,
details?: {
data?: unknown
pairingStage?: RemoteRuntimePairingStage
closeCode?: number
}
) {
super(message)
this.name = 'RemoteRuntimeClientError'
this.code = code
this.data = details?.data
this.pairingStage = details?.pairingStage
this.closeCode = details?.closeCode
}
}