Skip to content
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

Change StatusCode type to ContentfulStatusCode #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

thisistonydang
Copy link

In the onError handler, returning a c.json() response with a contentless status code will throw a type error, as c.json() requires content. This behavior was introduced in Hono v4.6.15.

To address this, changing the StatusCode type to ContentfulStatusCode in the onError handler should resolve the issue. However, can we safely assume that currentStatus is always a valid status code? Would it be better to maintain an array of valid status codes to check against, rather than simply casting currentStatus to ContentfulStatusCode?

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.

1 participant