Type Alias: ExecutionResult<T>
type ExecutionResult<T> =
| {
data: T;
ok: true;
}
| {
error?: IdentityExpiredError;
message: string;
ok: false;
status: number;
};Discriminated union for plugin execution results.
Replaces the previous T | undefined return type on execute().
On failure, the HTTP status code is preserved from:
AppKitErrorsubclasses (viastatusCode)- Any
Errorwith a numericstatusCodeproperty (e.g.ApiError) - All other errors default to status 500
In production, error messages from non-AppKitError sources are handled as:
- 4xx errors: original message is preserved (client-facing by design)
- 5xx errors: replaced with "Server error" to prevent information leakage
Type Parameters
| Type Parameter |
|---|
T |
Type Declaration
{
data: T;
ok: true;
}data
data: T;ok
ok: true;{
error?: IdentityExpiredError;
message: string;
ok: false;
status: number;
}error?
optional error: IdentityExpiredError;Typed credential expiry without changing the existing failure envelope.
message
message: string;ok
ok: false;status
status: number;