Download packages/chord/src/services/errors.ts from SaylorTwift/pi: direct link, hf CLI and curl.
- Browser
- Download file 785 Bytes
-
https://huggingface.co/SaylorTwift/pi/resolve/main/packages/chord/src/services/errors.ts
- Command line
-
hf download hf://SaylorTwift/pi/packages/chord/src/services/errors.ts
-
curl -L -o errors.ts https://huggingface.co/SaylorTwift/pi/resolve/main/packages/chord/src/services/errors.ts
785 Bytes
| export const REMOTE_SERVICE_ERROR_CODES = [ | |
| "service_not_allowed", | |
| "service_not_found", | |
| "service_mode_mismatch", | |
| "service_member_not_found", | |
| "service_member_mismatch", | |
| "service_instance_not_found", | |
| "service_stale_instance", | |
| "service_invalid_value", | |
| ] as const; | |
| export type RemoteServiceErrorCode = (typeof REMOTE_SERVICE_ERROR_CODES)[number]; | |
| export function isRemoteServiceErrorCode(value: unknown): value is RemoteServiceErrorCode { | |
| return typeof value === "string" && REMOTE_SERVICE_ERROR_CODES.includes(value as RemoteServiceErrorCode); | |
| } | |
| export class RemoteServiceError extends Error { | |
| readonly code: RemoteServiceErrorCode; | |
| constructor(code: RemoteServiceErrorCode, message: string) { | |
| super(message); | |
| this.name = "RemoteServiceError"; | |
| this.code = code; | |
| } | |
| } | |