fix(core): preserve structured error messages (#33530)
This commit is contained in:
@@ -29,7 +29,12 @@ export interface BoundResult {
|
||||
export class StorageError extends Schema.TaggedErrorClass<StorageError>()("ToolOutputStore.StorageError", {
|
||||
operation: Schema.Literals(["encode", "write"]),
|
||||
cause: Schema.Defect(),
|
||||
}) {}
|
||||
}) {
|
||||
override get message() {
|
||||
const detail = this.cause instanceof Error ? this.cause.message : String(this.cause)
|
||||
return `Failed to ${this.operation} tool output${detail ? `: ${detail}` : ""}`
|
||||
}
|
||||
}
|
||||
|
||||
export type Error = StorageError
|
||||
|
||||
|
||||
Reference in New Issue
Block a user