Closed labilbe closed 4 years ago
It doesn't preserve custom data in a custom Exception, ServiceStack serializes the Exception into a serializable ResponseStatus
DTO that it injects in the Response DTO following the Error Response Type rules.
Have a look at the Error Handling docs for how to return a custom exception. Everything needs to be captured in the ResponseStatus
DTO which also has a Meta
dictionary for additional custom info that doesn't fit in existing properties.
Thank you!
Environment
Steps to reproduce the behavior
Asp.Net MVC controller
Service DTO layer
Service Layer
When calling
Gateway.Send
, Exception is thrown and I enter on the catch block. The only problem is that ErrorMessages property is null (or empty). It should have two elements, "toto" and "test".I don't know if it's due to the ServiceStack version because I am migrating from autowired services (inside controllers) to Gateway.Send.
Thank you for your help!