mirror of
https://github.com/stablyai/orca.git
synced 2026-10-03 00:02:19 +00:00
22 lines
656 B
TypeScript
22 lines
656 B
TypeScript
export class BrowserClientPageCommandError extends Error {
|
|
constructor(message: string, options?: ErrorOptions) {
|
|
super(message, options)
|
|
}
|
|
}
|
|
|
|
export function browserClientPageCommandFailureCode(error: unknown, signal: AbortSignal): string {
|
|
if (error instanceof BrowserClientPageCommandError) {
|
|
return error.message
|
|
}
|
|
return signal.aborted
|
|
? 'browser_client_page_command_aborted'
|
|
: 'browser_client_page_command_failed'
|
|
}
|
|
|
|
export function isBrowserClientPageCleanupFailure(error: unknown): boolean {
|
|
return (
|
|
error instanceof BrowserClientPageCommandError &&
|
|
error.message === 'browser_client_page_cleanup_failed'
|
|
)
|
|
}
|