-
Notifications
You must be signed in to change notification settings - Fork 44
[Job Launcher] Refactor error handling #3326
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
Conversation
- Replaced instances of ControlledError with specific error classes (ValidationError, NotFoundError, ConflictError, ServerError) in QualificationService, RateService, RoutingProtocolService, SendGridService, StorageService, Web3Service, WebhookService, and their respective test files. - Removed the storage.errors.ts file as its functionality is now integrated into the common error handling. - Updated tests to reflect changes in error handling and ensure proper error types are thrown and caught.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
dnechay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks cleaner! Left some questions and suggestions
- in all places that are not directly used by http layer (e.g.
common/utilsorstorage.service) we probably should not use HTTP-related Errors, it's a bit confusing to see things likeConflictErrorwhen you validate web3 signature and not intuitive for developer from the future on how to pick some specific error class from all of these - I noticed that you changed "http-response code" for some cases (e.g. in
job.servicesome places have 409/422 vs 400 before), can it affect something on UI?
packages/apps/job-launcher/server/src/common/exceptions/exception.filter.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/common/guards/signature.auth.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/common/pipes/validation.ts
Outdated
Show resolved
Hide resolved
...es/apps/job-launcher/server/src/modules/content-moderation/gcv-content-moderation.service.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/modules/storage/storage.service.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/modules/webhook/webhook.service.ts
Outdated
Show resolved
Hide resolved
packages/apps/job-launcher/server/src/common/utils/signature.ts
Outdated
Show resolved
Hide resolved
|
Please double-check that client-facing (I mean FE app) functionality is not broken in places where status codes changed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Let's wait for @portuu3 and released yarn upgrade
* Refactor error handling across services to use custom error classes - Replaced instances of ControlledError with specific error classes (ValidationError, NotFoundError, ConflictError, ServerError) in QualificationService, RateService, RoutingProtocolService, SendGridService, StorageService, Web3Service, WebhookService, and their respective test files. - Removed the storage.errors.ts file as its functionality is now integrated into the common error handling. - Updated tests to reflect changes in error handling and ensure proper error types are thrown and caught. * feat: enhance error handling and validation across services * feat: add logging for missing user object in WhitelistAuthGuard * fix: update error handling for card deletion and signature verification
Issue tracking
N/A
Context behind the change
Refactor error handling across services to use custom error classes:
How has this been tested?
Release plan
None
Potential risks; What to monitor; Rollback plan
Check that the new errors are not instance of ControlledError