Open WangHansen opened 5 years ago
The conclusion in #52 was to use the WError
class for this. Does that not do what you want?
@davepacheco Sorry I should have mentioned this. Yes, I did look at #52. The problem with using WError
is that I lose the ability to get the chained message by calling error.message
if I understand correctly.
The solution I was looking for is to provide a way to get both the chained long error message and the short version as well. It seems that with VError
or WError
, I can get either a short or a long version but not both.
Thanks for clarifying. I haven't thought about it much but it seems like we could add a method to WError to get the long message. I prefer that slightly to adding a short message to VError but either may be okay.
No problem, thanks so much for all the hard work, this is an amazing library!
I would prefer just adding it to VError
just because I am mostly using VError
throughout my code and I guess it would be the same for a lot of other developers. Maybe I am wrong. Works either way.
This is exactly the same request as the #52.
The use case is that I want to capture the entire error with all the causes for debugging, logging and other purposes. But when I return the JSON back to the client. I only want the user to see what is in the "jse_shortmsg".
For example: