-
Notifications
You must be signed in to change notification settings - Fork 65
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
Customizable Error Messages #219
Comments
I would favor option 2 as well. Implicits in the project already are taken to its extreme, and adding more overrides could makes things harder to understand, specially when they go wrong. |
Hello |
@RafalSumislawski The |
If I can add my 2 cents about handling errors with For example this exception will be handled by
But this one not:
It would be caught and logged in PathTree.scala#136 I don't know if that is a design decision or not, but currently one needs to be very careful in the routes code. |
I have a requirement for my APIs where all messages are in JSON format.
Rho has several places where error messages are hard coded.
I would prefer if users can specify their own error messages so they can be JSON, ProtoBuf, XML, Japanese, or whatever a user might need.
To list a few:
(Line numbers based on tag
v0.18.0-M1
instead ofmaster
for stability)PathTree.scala
line 263QueryParser.scala
lines 76 and 80StringParser.scala
line 21 31 (A few more because of DateTime parser branch merge)package.scala
line 71, 81, 91, 101, 183, 259, and 264I would LOVE to submit a PR to make this easier, but would like to discuss what the best path is to make this more usable.
The way I see it is we have 2 choices...
_captureMapR
inpackage.scala
protected
so i can override it when I inherit fromRhoDSL
Paths
,Headers
,QueryParams
with an sealed class hierarchy of error types and have a default implicit function that gives the existing error messages.param
,capture
+?
, etc to take an implicit error handler of sorts.I prefer path 2, but want some suggestions before I get start on this.
The text was updated successfully, but these errors were encountered: