The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 1 | import { ProviderDriverKind, ProviderInstanceId } from "@t3tools/contracts"; |
| 2 | import * as Schema from "effect/Schema"; |
| 3 | |
| 4 | export class ProviderDriverError extends Schema.TaggedError<ProviderDriverError>()( |
| 5 | "ProviderDriverError", |
| 6 | { |
| 7 | driver: ProviderDriverKind, |
| 8 | instanceId: ProviderInstanceId, |
| 9 | detail: Schema.String, |
| 10 | cause: Schema.optional(Schema.Defect()), |
| 11 | }, |
| 12 | ) { |
| 13 | override get message(): string { |
| 14 | return `Provider driver '${this.driver}' failed to create instance '${this.instanceId}': ${this.detail}`; |
| 15 | } |
| 16 | } |
| 17 | |
| 18 | export class ProviderCredentialError extends Schema.TaggedError<ProviderCredentialError>()( |
| 19 | "ProviderCredentialError", |
| 20 | { |
| 21 | operation: Schema.Literals(["get", "set", "remove"]), |
| 22 | cause: Schema.Defect(), |
| 23 | }, |
| 24 | ) { |
| 25 | override get message(): string { |
| 26 | return `Could not ${this.operation} stored provider credentials.`; |
| 27 | } |
| 28 | } |