Fix: migrate domain specific errors into their module#137
Fix: migrate domain specific errors into their module#137Villarley merged 1 commit intoVolunChain:mainfrom
Conversation
WalkthroughThe changes introduce new and refactored test suites for error classes, centralize and update error-related exports, and adjust import paths across the codebase to use new module locations. Error class hierarchies are updated to inherit from a domain-specific exception base, and new index files are added for organized error exports. Changes
Sequence Diagram(s)sequenceDiagram
participant Service
participant ErrorClass
participant DomainException
Service->>ErrorClass: throw new CustomError(...)
ErrorClass->>DomainException: super(message)
DomainException-->>ErrorClass: initialize base properties
ErrorClass-->>Service: error instance created with code, statusCode, details
Service->>Service: catch CustomError and handle
sequenceDiagram
participant VolunteerService
participant VolunteerError
participant DomainException
VolunteerService->>VolunteerError: throw new VolunteerRegistrationError(...)
VolunteerError->>DomainException: super(message)
DomainException-->>VolunteerError: initialize base properties
VolunteerError-->>VolunteerService: error instance created
VolunteerService->>VolunteerService: catch VolunteerRegistrationError and handle
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (12)
🧰 Additional context used🧬 Code Graph Analysis (2)__tests__/application/errors/volunteer-registration.errors.test.ts (1)
__tests__/application/errors/common.errors.test.ts (1)
🔇 Additional comments (31)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
🚀 Volunchain Pull Request
Mark with an
xall the checkboxes that apply (like[x])📌 Type of Change
📝 Changes description
I successfully migrated all domain-specific errors from the legacy src/errors/ directory to their appropriate modules under the new architecture.
📸 Evidence (A photo is required as evidence)
⏰ Time spent breakdown
4 hours
🌌 Comments
Thank you for contributing to Volunchain, we are glad that you have chosen us as your project of choice and we hope that you continue to contribute to this great project, so that together we can make our mark at the top!
Summary by CodeRabbit
Refactor
Tests