All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2026-01-25
- Observability module (
src/observability.ts) for production error monitoring:generateFingerprint()- Create unique error fingerprints for deduplicationtoLogEntry()- Convert errors to structured log entries (pino/winston/bunyan compatible)toOtelAttributes()- Generate OpenTelemetry-compatible span attributesrecordError()- Helper for recording errors on OTel spans with proper status codes
- Framework integration examples:
- Express middleware integration
- Hono middleware integration
- GraphQL error handling
- React error boundaries
- tRPC error handling
- Zod validation integration
- Logging integration patterns
- API is now stable - This is the first stable release following semantic versioning
- Package metadata improved with proper
repositoryobject format andbugsfield
- Verified no prototype pollution vulnerabilities (uses
deepmerge-ts) - Safe handling of untrusted input in
ErrorX.from()(safe property access patterns) - Metadata serialization uses
safe-stringifyfor circular reference handling
0.6.0 - 2026-01-20
ErrorXResolverclass for resolving ErrorX instances to enhanced presentation objects- Type-safe error type determination via
onResolveTypecallback - i18n integration with custom resolver functions
- Documentation URL building with
docs.baseUrlanddocsPathoptions - Custom config properties support for domain-specific needs
- Config hierarchy: defaults → type config → preset config
- Custom result type transformation via
onTransformResult
- Type-safe error type determination via
- New type definitions in
types/resolver.types.tsfor resolver functionality
- Refactored UI message exports for better organization
httpErrorUiMessagesnow keyed by status codedbErrorUiMessageskeyed by preset namevalidationErrorUiMessagefor default validation message
- Split type definitions into separate files for better maintainability:
types/core.types.ts- Core type definitionstypes/resolver.types.ts- Resolver-specific typestypes/serialization.types.ts- Serialization typestypes/transform.types.ts- Transform types
uiMessageproperty from ErrorX class (useErrorXResolverinstead)
0.5.1 - 2026-01-19
- Enhanced serialization and deserialization to preserve all properties in error chains
- Improved chain restoration from JSON with full property preservation
- Renamed
ErrorXCausetype toErrorXSnapshotfor clarity
0.5.0 - 2026-01-19
DBErrorXclass with presets for common database errors:CONNECTION_FAILED,QUERY_FAILED,UNIQUE_VIOLATION,FOREIGN_KEY_VIOLATIONNOT_NULL_VIOLATION,CHECK_VIOLATION,TIMEOUT,DEADLOCKTRANSACTION_FAILED,SERIALIZATION_FAILURE
ValidationErrorXclass with:fromZodError()static method for Zod integrationforField()static method for field-specific validation errors- Presets:
INVALID_FORMAT,REQUIRED_FIELD,OUT_OF_RANGE,INVALID_TYPE
- Major internal refactoring for improved code organization
- Updated format script configuration
0.4.6 - 2025-10-06
- Documentation section in README
- GitHub Pages configuration for API documentation
- Improved documentation generation scripts
0.4.5 - 2025-10-06
- Enhanced ErrorX metadata extraction from source errors
- Updated documentation with improved examples
- Homepage URL in package.json to reflect correct repository
0.4.4 - 2025-10-06
timestampproperty now uses Unix epoch (milliseconds) instead of ISO stringwithMetadata()signature updated to support additional metadata type parameter- Improved
toString()output format for better readability
0.4.3 - 2025-10-06
- HTTP presets now indexed by status code (e.g.,
HTTPErrorX.create(404)) - Improved consistency in preset usage patterns
0.4.2 - 2025-10-06
cleanStackDelimiterconfiguration option for trimming stack traces at a specific line
- Renamed stack cleaning configuration for clarity
0.4.1 - 2025-10-05
- Updated ErrorX cause type to
ErrorXCausefor improved type safety - Refactored error handling to use
ErrorXCauseformat for cause property
0.4.0 - 2025-10-05
HTTPErrorXclass with presets for all standard HTTP status codes (400-511)- Type-safe metadata support with generics
ErrorX.configure()static method for global configurationcleanStackconfiguration option with customizable patterns- Frozen HTTP presets for immutability
codefield inErrorXOptionsnow accepts both string and number types- Improved HTTP error preset messages for consistency
- Message casing for HTTP error presets
0.3.0 - 2025-09-30
- Preset support integrated directly into ErrorX class
ErrorX.create()factory method for preset-based creation
- Refactored actions structure for consistency
- Removed separate presets module in favor of integrated approach
0.2.2 - 2025-09-30
- Enhanced README with error presets documentation
- API documentation improvements with usage patterns
0.2.1 - 2025-09-30
httpStatusfield for HTTP error status codestypefield for error categorization- Presets for common HTTP error configurations
- Metadata access using optional chaining for safety
- Validation for
httpStatusandtypein constructor
0.2.0 - 2025-09-29
ERROR_X_OPTION_FIELDSconstant for centralized validation- Smart conversion in constructor (supports string messages directly)
- Enhanced
ErrorXOptionstype for improved flexibility and ergonomics - Streamlined options conversion logic in constructor
- Updated documentation links to use scoped package name
0.1.1 - 2025-08-18
- Initial release of error-x
ErrorXclass extending nativeErrorwith:codeproperty with automatic generation from name (UPPER_SNAKE_CASE)messagefor technical error descriptionsnamefor error type identificationmetadatafor additional contexttimestampfor error occurrence trackingchainproperty for full error sequence accessparentandrootproperties for error chain navigationoriginalproperty for non-ErrorX wrapped entities
ErrorX.from()static method for converting any value to ErrorXErrorX.fromJSON()for deserializationErrorX.isErrorX()type guardErrorX.cleanStack()for removing internal frames from stack traceswithMetadata()instance method for creating errors with merged metadatatoJSON()for serializationtoString()for detailed string representation- Safe JSON serialization handling circular references
- Comprehensive test suite
- Initial documentation