js-bao-wss-client / FunctionRunError
Interface: FunctionRunError
Why a function run failed. The ONE structured error on this surface.
The workflow type carries two fields for this — a raw error passthrough and a normalized failure beside it — because principle 5 forbade moving a published value. This is a new type, so it has one.
Properties
code?
optionalcode?:FunctionRunErrorCode
The platform's classification, when it made one. The same value as FunctionRun.errorCode, lifted here so a caller reading the error does not have to also hold the run block.
details?
optionaldetails?:Record<string,unknown>
Any remaining wire keys, key for key.
message
message:
string
What went wrong. Always present: an error the client publishes is one it can describe. A platform refusal leads its message with its code.
name?
optionalname?:string
The thrown error's own NAME, when the engine preserved one (Error, TypeError, a tenant's own class). Absent for a failure read off the persisted row — the platform keeps only the message there and labels it WorkflowError, which is a placeholder and not a name, so this client drops it — and absent whenever the engine dropped the name. Never the code: read code for that.