[LOCKLITE-104] Refactor error handling#64
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors error handling by consolidating error classes, restructuring error responses, and reorganizing file paths to improve maintainability and consistency across the codebase.
- Consolidates error handling by moving HttpError to shared module and creating BusinessError for domain-specific errors
- Restructures error response format to use nested object structure with message and optional code fields
- Reorganizes file paths by moving types and props to more appropriate directories and updating import paths
Reviewed Changes
Copilot reviewed 33 out of 35 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/modules/shared/errors/http-error.ts | New shared HttpError base class with status and toString method |
| src/modules/shared/errors/business-error.ts | New BusinessError class extending HttpError with error codes |
| src/modules/api/helpers/api/handle-api-request.ts | Updated error handling to support new error structure and nested response format |
| src/modules/ui/services/locklite-api-request.service.ts | Refactored with improved error handling and method extraction |
| src/modules/shared/dto/output/errors/http.error.dto.ts | Updated DTO to use nested error object structure |
| src/modules/api/usecases/vaults/create-vault.usecase.ts | Added specific error handling for vault creation scenarios |
src/modules/api/errors/business/vaults/vault-label-too-long.error.ts
Outdated
Show resolved
Hide resolved
…ipt-eslint/no-unnecessary-condition rules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.