Skip to content

[Feature]: Add notes property to ErrorInstance #10

Closed as not planned
Closed as not planned

Description

@martyy-code

Feature Description

Add the notes property to ErrorInstance type to store an array of note strings added via .addNote().

Problem It Solves

  • The notes property is required to store notes added via .addNote()
  • Enables access to error notes programmatically
  • Part of the v1.1.0 enhanced developer experience

Proposed Solution

export type ErrorInstance<T extends Record<string, unknown> = Record<string, unknown>> = {
  context: Record<string, unknown> | null;
  notes: string[];
  addNote: (note: string) => ErrorInstance<T>;
};
  • notes: string[] property initialized as empty array by default
  • Mutation via .addNote() method
  • Part of the same v1.1.0 release as .addNote()

Alternatives Considered

  • Separate v1.1.1 release for just the notes property (not efficient)
  • Lazy initialization (adds complexity without benefit.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions