Skip to content

feat(parseResponse): set DetailedError.name (+ error tests)#4344

Merged
yusukebe merged 2 commits intohonojs:mainfrom
NamesMT:parseResponse/DetailedErrorName
Aug 8, 2025
Merged

feat(parseResponse): set DetailedError.name (+ error tests)#4344
yusukebe merged 2 commits intohonojs:mainfrom
NamesMT:parseResponse/DetailedErrorName

Conversation

@NamesMT
Copy link
Copy Markdown
Contributor

@NamesMT NamesMT commented Aug 8, 2025

This PR simply set the .name for the DetailedError class, which is a good pratice, so user is able to do a fast equality check in code / search for the error in log.

I forgot to add it previously and just hit a case where I need it because I have DetailedError classes coming from multiple source and instanceof is a bit wonky.

I also added tests for cases where error is thrown.

Theoretically "breaking", but should be safe to include in next patch.

The author should do the following, if applicable

  • Add tests
  • Run tests
  • bun run format:fix && bun run lint:fix to format the code
  • Add TSDoc/JSDoc to document the codefix

@codecov
Copy link
Copy Markdown

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.41%. Comparing base (82bdc4d) to head (ccc698e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #4344    +/-   ##
========================================
  Coverage   91.41%   91.41%            
========================================
  Files         172      172            
  Lines       10900    10901     +1     
  Branches     3268     3163   -105     
========================================
+ Hits         9964     9965     +1     
  Misses        935      935            
  Partials        1        1            

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@yusukebe yusukebe changed the title chore(parseResponse): set DetailedError.name (+ error tests) feat(parseResponse): set DetailedError.name (+ error tests) Aug 8, 2025
Copy link
Copy Markdown
Member

@yusukebe yusukebe left a comment

Choose a reason for hiding this comment

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

LGTM!

@yusukebe
Copy link
Copy Markdown
Member

yusukebe commented Aug 8, 2025

@NamesMT

Ah, name is useful. Yes. We can include this change into the next patch release. Thanks!

@yusukebe yusukebe merged commit 855e5b1 into honojs:main Aug 8, 2025
20 checks passed
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