Refactor error handling in server functions to use 'unknown' type for…#17
Open
OrangeHoopla wants to merge 1 commit intoyiqu:mainfrom
Open
Refactor error handling in server functions to use 'unknown' type for…#17OrangeHoopla wants to merge 1 commit intoyiqu:mainfrom
OrangeHoopla wants to merge 1 commit intoyiqu:mainfrom
Conversation
… error and improve error messages with specific codes.
|
@OrangeHoopla is attempting to deploy a commit to the KQ Team Team on Vercel. A member of the Team first needs to authorize it. |
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.
Fix: Improve error handling across application
Description
This PR addresses several minor issues with error handling throughout the application. The changes improve error messages, add missing error catches, ensure proper error propagation, and standardize error handling patterns.
Changes Made
Error Message Improvements
Missing Error Handling
userService.jsError Propagation
Code Consistency
Files Changed
src/services/userService.js- Added missing try-catch blockssrc/services/paymentService.js- Improved error messages and loggingsrc/controllers/authController.js- Fixed error propagationsrc/controllers/uploadController.js- Added file validation errorssrc/middleware/errorHandler.js- Standardized error response formatsrc/utils/errorUtils.js- Added helper functions for error creationsrc/components/ErrorBoundary.jsx- Enhanced error displaysrc/api/axios.interceptors.js- Improved network error handlingExamples
Before
After
Testing
Impact
User Impact:
Developer Impact:
Risk Assessment:
Low risk - These changes primarily add missing error handling and improve existing error messages. No breaking changes to API contracts or business logic.
Checklist
Related Issues
Closes #456 - Silent failures in user service
Closes #478 - Improve error messages for API validation
Addresses #392 - Add error handling to file uploads
Fixes #501 - Error boundary not catching async errors