Skip to content

feat(event-handler): add error classes for http errors #4299

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 5 commits into from
Aug 11, 2025

Conversation

svozza
Copy link
Contributor

@svozza svozza commented Aug 11, 2025

Summary

To reduce the size of the PR for #4141 I'm doing an initial PR that just adds the error classes for various HTTP error codes.

Changes

New Error Classes (src/rest/errors.ts):

Added 8 new HTTP error classes extending base class called ServiceError:

  • BadRequestError (400)
  • UnauthorizedError (401)
  • ForbiddenError (403)
  • MethodNotAllowedError (405)
  • RequestTimeoutError (408)
  • RequestEntityTooLargeError (413)
  • InternalServerError (500)
  • ServiceUnavailableError (503)

All classes support optional custom messages, error options, and additional details

Issue number: closes #4141


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

@svozza svozza requested a review from dreamorosi August 11, 2025 12:18
@svozza svozza self-assigned this Aug 11, 2025
@pull-request-size pull-request-size bot added the size/L PRs between 100-499 LOC label Aug 11, 2025
@boring-cyborg boring-cyborg bot added event-handler This item relates to the Event Handler Utility tests PRs that add or change tests labels Aug 11, 2025
@svozza svozza changed the title add error classes for http errors feat(event-handler): add error classes for http errors Aug 11, 2025
@pull-request-size pull-request-size bot added size/XL PRs between 500-999 LOC, often PRs that grown with feedback and removed size/L PRs between 100-499 LOC labels Aug 11, 2025
@svozza svozza force-pushed the event-handler/error-handling-rest-api branch from 841e69b to 066d25a Compare August 11, 2025 15:21
@pull-request-size pull-request-size bot added size/L PRs between 100-499 LOC and removed size/XL PRs between 500-999 LOC, often PRs that grown with feedback labels Aug 11, 2025
@svozza svozza requested review from dreamorosi and removed request for dreamorosi August 11, 2025 18:02
Copy link

@svozza svozza merged commit c1c3dd5 into main Aug 11, 2025
34 checks passed
@svozza svozza deleted the event-handler/error-handling-rest-api branch August 11, 2025 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-handler This item relates to the Event Handler Utility size/L PRs between 100-499 LOC tests PRs that add or change tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request: Implement Error Handling System for Event Handler
2 participants