Common utilities for error handling within Backstage with structured error classes and serialization functions
63
{
"context": "Evaluates how well the solution uses @backstage/errors to model failed HTTP responses with the typed consumed-response and error-payload shapes, and to rebuild errors from those structured payloads. Emphasis is on relying on the library’s provided types and helpers rather than custom ad hoc parsing.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Typed response input",
"description": "Failed-response inputs are typed as ConsumedResponse (augmented with text()) instead of plain fetch Response or any, reflecting an already-consumed body.",
"max_score": 20
},
{
"name": "Payload typing",
"description": "Structured payloads are represented with ErrorResponseBody (and its SerializedError error field) rather than bespoke shapes, keeping request and response sections aligned with the package type.",
"max_score": 25
},
{
"name": "Parse helper reuse",
"description": "JSON-like bodies are parsed via parseErrorResponseBody using a ConsumedResponse wrapper that returns the cached body text, instead of manual JSON parsing.",
"max_score": 20
},
{
"name": "Fallback serialization",
"description": "When the body is plain text or invalid JSON, a SerializedError payload is still produced with the original status from ConsumedResponse and sensible default name/message values.",
"max_score": 15
},
{
"name": "Error rebuild",
"description": "Error reconstruction leverages deserializeError (or ResponseError built from ErrorResponseBody) so the thrown Error carries the payload’s name/message and includes the status code in the message; throws if error data is missing.",
"max_score": 20
}
]
}Install with Tessl CLI
npx tessl i tessl/npm-backstage--errorsevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10