Returns
| {
code?: string;
customSections?: { body: string
| string[][]; title?: string }[];
details?: unknown;
message: string;
nextSteps?: string[];
tryMessage?: string;
type: "abort";
}
| {
code?: string;
customSections?: { body: string
| string[][]; title?: string }[];
details?: unknown;
message: string;
nextSteps?: string[];
stack?: string;
tryMessage?: string;
type: "bug";
}
| {
args: string[];
code?: string;
command: string;
customSections?: { body: string
| string[][]; title?: string }[];
details?: unknown;
message: string;
nextSteps?: string[];
tryMessage?: string;
type: "external";
}
The error classification, message, and available recovery information.
Projects an error into the shared JSON error contract, retaining only allowlisted fields.