- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Chi should not panic when no routes #362
Comments
Why don't you add a 404 handler in your skeleton app's code? I'm not sure if this is the right call. The panic might be useful for some folks that forget to mount the handlers correctly. Let's poll the community for their opinions: |
I understood your point, but in this case we create a service which can panic at the random moment when someone send any http request. And developer don't know about this behavior. Maybe we should panic at service startup |
@makhov that's a good point, thanks. Let me add it as a third option to the poll. |
done in #378 -- in v4, we will return 404 for an empty mux |
Hello!
We use a generic service skeleton based on chi in our company. Sometimes we needn't handle http-request and our skeleton creates chi.Mux with no roures.
If someone try to ping our service, it fails with panic because of this if section.
I think Chi should return 404 error instead of panic.
The text was updated successfully, but these errors were encountered: