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.
Feature Description
Add the
notesproperty toErrorInstancetype to store an array of note strings added via.addNote().Problem It Solves
notesproperty is required to store notes added via.addNote()Proposed Solution
notes: string[]property initialized as empty array by default.addNote()method.addNote()Alternatives Considered