Common utilities for error handling within Backstage with structured error classes and serialization functions
63
{
"context": "Evaluates whether the solution leverages @backstage/errors guards to validate and normalize unknown error values as described in the spec. Confirms the code relies on the library instead of reimplementing shape checks by hand.",
"type": "weighted_checklist",
"checklist": [
{
"name": "Use isError",
"description": "Uses @backstage/errors isError to detect existing Error instances or error-shaped values before returning or collecting them, instead of manual property checks.",
"max_score": 25
},
{
"name": "Assert invalid",
"description": "Employs assertError from @backstage/errors when enforcing the presence of non-empty name/message fields in ensureError, producing a TypeError for invalid inputs.",
"max_score": 30
},
{
"name": "Shape to Error",
"description": "When given plain objects with name/message strings, converts them into real Error objects while keeping the provided name and message, driven by the package guards rather than ad-hoc checks.",
"max_score": 20
},
{
"name": "Skip non-errors",
"description": "collectErrors relies on isError (or an assertError gate) to omit or reject non-error values from mixed arrays without misclassifying primitives or objects lacking the required shape.",
"max_score": 25
}
]
}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