fix(core): preserve concise error messages
This commit is contained in:
parent
bf24cf423c
commit
8fac3f7ce7
2 changed files with 2 additions and 4 deletions
|
|
@ -5,7 +5,6 @@ import { Cause, Context, Effect, Layer, Schema, Scope } from "effect"
|
|||
import { ModelV2 } from "./model"
|
||||
import { ProviderV2 } from "./provider"
|
||||
import { State } from "./state"
|
||||
import { errorMessage } from "./util/error"
|
||||
|
||||
type SDK = any
|
||||
|
||||
|
|
@ -126,7 +125,7 @@ export class InitError extends Schema.TaggedErrorClass<InitError>()("AISDK.InitE
|
|||
cause: Schema.Defect(),
|
||||
}) {
|
||||
override get message() {
|
||||
return `Failed to initialize AI SDK provider ${this.providerID}: ${errorMessage(this.cause)}`
|
||||
return `Failed to initialize AI SDK provider: ${this.providerID}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,8 +179,7 @@ export class AuthorizationError extends Schema.TaggedErrorClass<AuthorizationErr
|
|||
cause: Schema.Defect(),
|
||||
}) {
|
||||
override get message() {
|
||||
const detail = this.cause instanceof Error ? this.cause.message : String(this.cause)
|
||||
return `Integration authorization failed${detail ? `: ${detail}` : ""}`
|
||||
return "Integration authorization failed"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue