fix(core): preserve concise error messages

This commit is contained in:
Aiden Cline 2026-06-23 18:48:22 -05:00
commit 8fac3f7ce7
2 changed files with 2 additions and 4 deletions

View file

@ -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}`
}
}

View file

@ -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"
}
}