fix(core): preserve structured error messages (#33530)
This commit is contained in:
@@ -61,6 +61,7 @@ describe("AppProcess", () => {
|
||||
if (reason && reason._tag === "Fail") {
|
||||
expect(reason.error).toBeInstanceOf(AppProcess.AppProcessError)
|
||||
expect((reason.error as AppProcess.AppProcessError).exitCode).toBe(1)
|
||||
expect((reason.error as AppProcess.AppProcessError).message).toContain("Command failed (exit 1)")
|
||||
} else {
|
||||
throw new Error("expected fail reason")
|
||||
}
|
||||
|
||||
@@ -212,6 +212,7 @@ describe("SessionRunnerModel", () => {
|
||||
modelID: "test-model",
|
||||
variant: "unknown",
|
||||
})
|
||||
expect(failure.message).toBe("Variant unavailable for test-provider/test-model: unknown")
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -328,6 +329,7 @@ describe("SessionRunnerModel", () => {
|
||||
modelID: "test-model",
|
||||
api: "aisdk:@ai-sdk/google",
|
||||
})
|
||||
expect(failure.message).toBe("Unsupported API for test-provider/test-model: aisdk:@ai-sdk/google")
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
@@ -206,6 +206,7 @@ describe("ToolRegistry", () => {
|
||||
|
||||
expect(Exit.isFailure(exit)).toBe(true)
|
||||
if (Exit.isFailure(exit)) expect(Option.getOrUndefined(Cause.findErrorOption(exit.cause))).toBe(retentionFailure)
|
||||
expect(retentionFailure.message).toBe("Failed to write tool output: disk full")
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user