CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-aggregate-error

Create an error from multiple errors

94

1.28x
Overview
Eval results
Files

rubric.jsonevals/scenario-5/

{
  "context": "This evaluation assesses how well an engineer uses the aggregate-error package to build a custom ValidationError class that properly extends the Error interface. The focus is exclusively on correct usage of aggregate-error's API for error aggregation, normalization, and standard Error class compliance.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "AggregateError import",
      "description": "Imports the AggregateError class from the 'aggregate-error' package using the correct ESM import syntax (import AggregateError from 'aggregate-error')",
      "max_score": 10
    },
    {
      "name": "AggregateError instantiation",
      "description": "Creates an instance of AggregateError in the ValidationError constructor, passing the failures array to it (new AggregateError(failures))",
      "max_score": 25
    },
    {
      "name": "Error inheritance",
      "description": "Properly extends the native Error class or uses AggregateError's built-in Error extension to ensure ValidationError inherits standard Error properties (name, message, stack)",
      "max_score": 20
    },
    {
      "name": "Error normalization",
      "description": "Leverages AggregateError's built-in error normalization to handle mixed input types (Error instances, plain objects, strings) without reimplementing conversion logic",
      "max_score": 15
    },
    {
      "name": "Read-only access pattern",
      "description": "Uses AggregateError's 'errors' property getter to access aggregated errors, and exposes them through a 'failures' getter that returns a copy or delegates to AggregateError's errors property",
      "max_score": 15
    },
    {
      "name": "Input validation",
      "description": "Relies on AggregateError's built-in array validation that throws a TypeError for non-array inputs, or explicitly delegates validation to AggregateError",
      "max_score": 10
    },
    {
      "name": "Error name property",
      "description": "Sets the 'name' property to 'ValidationError' to properly identify the custom error type while maintaining Error interface compliance",
      "max_score": 5
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-aggregate-error

tile.json