Skip to content

refactor(core): standardize HttpError#2858

Merged
marvinhagemeister merged 3 commits into
freshframework:mainfrom
iuioiua:HttpError-extends-Error
Apr 27, 2025
Merged

refactor(core): standardize HttpError#2858
marvinhagemeister merged 3 commits into
freshframework:mainfrom
iuioiua:HttpError-extends-Error

Conversation

@iuioiua

@iuioiua iuioiua commented Apr 25, 2025

Copy link
Copy Markdown
Contributor
  • Now extends Error, so that it satisfies instanceof Error operations.
  • Narrows the status property to be an actual HTTP status code.
  • Outsources default evaluation of the message property to @std/http/status, which already implements this functionality.
  • Brings the stack property to the class, regardless of its status, which seems like a needless constraint.

@iuioiua iuioiua changed the title refactor(core): have HttpError extend Error refactor(core): standardize HttpError Apr 25, 2025
@iuioiua iuioiua marked this pull request as ready for review April 25, 2025 22:48

@marvinhagemeister marvinhagemeister left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@marvinhagemeister marvinhagemeister merged commit 7aec5a2 into freshframework:main Apr 27, 2025
7 checks passed
@iuioiua iuioiua deleted the HttpError-extends-Error branch April 27, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants