[nit] Show error message from response (#3308)

This commit is contained in:
Chenlei Hu
2025-04-02 10:39:10 -04:00
committed by GitHub
parent ccb71bf1a3
commit db575425fe

View File

@@ -156,11 +156,12 @@ export class PromptExecutionError extends Error {
}
override toString() {
let message = super.message
let message = ''
if (typeof this.response.error === 'string') {
message += ': ' + this.response.error
} else if (this.response.error.details) {
message += ': ' + this.response.error.details
message += this.response.error
} else if (this.response.error) {
message +=
this.response.error.message + ': ' + this.response.error.details
}
for (const [_, nodeError] of Object.entries(