Skip to content

feat(core): Implement HTTP exception handling with RFC 7807 #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 24, 2025

Conversation

m-mdy-m
Copy link
Member

@m-mdy-m m-mdy-m commented Feb 24, 2025

  • Core HttpException class with RFC 7807 Problem Details format support
  • Complete set of 40+ HTTP exception classes covering all standard status codes
  • Comprehensive error configuration (HTTP_ERRORS) with detailed descriptions
  • Type-safe exception options interface (HttpExceptionOptions)
  • Utility methods for problem details serialization and JSON conversion
  • Documentation (docs/api/http-exception.doc.md) covering:
    • Standard usage patterns
    • Custom error creation
    • Problem details format specification
    • Extension mechanism for custom fields
      This foundational implementation establishes @medishn/toolkit's error handling infrastructure, providing robust, standards-compliant error management for HTTP-based applications. The solution balances strict RFC compliance with practical extensibility, serving as core infrastructure for consistent error reporting across services.

View Documentation

…g and context awareness

- Core `Logger` class implementing `LoggerService` interface
- Comprehensive logging API supporting 5 severity levels
- ANSI style management system with 16 color combinations
- Contextual logging with customizable display options
- Documentation (`docs/api/logger.doc.md`) covering:
  - Configuration options
  - Style customization guide
  - Best practices for production use
  - Performance considerations
- Type-safe configuration through `LoggerOptions` interface
- Formatting handlers for:
  - Error object stack traces
  - Complex object visualization
  - Primitive value styling
- Log filtering system with level-based controls
- Cross-platform color support detection

This implementation establishes a foundation for application diagnostics, balancing developer experience with production robustness. The logger serves as a core observability tool while maintaining zero dependencies.

[View Documentation](https://github.com/medishen/toolkit/blob/main/docs/api/logger.doc.md)
- Core `HttpException` class with RFC 7807 Problem Details format support
- Complete set of 40+ HTTP exception classes covering all standard status codes
- Comprehensive error configuration (`HTTP_ERRORS`) with detailed descriptions
- Type-safe exception options interface (`HttpExceptionOptions`)
- Utility methods for problem details serialization and JSON conversion
- Documentation (`docs/api/http-exception.doc.md`) covering:
  - Standard usage patterns
  - Custom error creation
  - Problem details format specification
  - Extension mechanism for custom fields
This foundational implementation establishes @medishn/toolkit's error handling infrastructure, providing robust, standards-compliant error management for HTTP-based applications. The solution balances strict RFC compliance with practical extensibility, serving as core infrastructure for consistent error reporting across services.

[View Documentation](https://github.com/medishen/toolkit/blob/main/docs/api/http-exception.doc.md)
@m-mdy-m m-mdy-m merged commit a156c8c into main Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant