-
Notifications
You must be signed in to change notification settings - Fork 76
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
How do you set metadata on HttpError? #644
Comments
Sorry. It looks like that quote is from the very early days and was probably more aspirational and directional than real. I don't think there's currently a way to do this. It hasn't been a big pain point for us yet (which is not to say it's not important -- I totally get the motivation). See also #41, #39. These are related, but not the same thing. One of those solutions might help here. Another thought is that instead of returning @ahl thoughts? |
No worries! In KittyCAD we're building a lot of stuff on Dropshot, so I'd definitely like to make that feature more than aspirational and actually implement it :) I'm happy to open a PR if we can get consensus on a good direction. The two mutually-exclusive approaches I can see easily are:
|
I third your idea @davepacheco (@adamchalmers 's number 1). This would solve #801 for me and make it possible to display these more informative error messages in a web UI, satisfying CORS. |
Closing as a dup of #39. |
Hi! The docs for HttpError say it includes "optionally: additional metadata describing the issue". But I don't see any method to get/set metadata, nor is there a field for it.
The HttpError docs should describe how this feature works and provide an example. Putting structured data into your errors, for clients to consume, is pretty important to a lot of servers :) Happy to write the docs if y'all can point me to how this works.
The text was updated successfully, but these errors were encountered: