You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're constructing a custom Maru type (use Maru.Type), and in our parse/2 function we do certain validations that may fail. But there doesn't seem to be a way to report validation errors back to the HTTP client. Returning {:error, …} from parse/2 doesn't trigger any special behavior, so we currently raise a custom exception. Looking at runtime.ex, it looks like the exception is handled and rethrown without any of the original exception data. So that when our code tries to rescue from Maru.Exceptions.Validation, we don't have enough context to produce a specific client response.
Is there a solution to this I'm missing? If not, would you accept a patch to include "inner exception" data in Maru.Exceptions.Validation?
The text was updated successfully, but these errors were encountered:
We're constructing a custom Maru type (
use Maru.Type
), and in ourparse/2
function we do certain validations that may fail. But there doesn't seem to be a way to report validation errors back to the HTTP client. Returning{:error, …}
fromparse/2
doesn't trigger any special behavior, so we currentlyraise
a custom exception. Looking at runtime.ex, it looks like the exception is handled and rethrown without any of the original exception data. So that when our code tries torescue from Maru.Exceptions.Validation
, we don't have enough context to produce a specific client response.Is there a solution to this I'm missing? If not, would you accept a patch to include "inner exception" data in
Maru.Exceptions.Validation
?The text was updated successfully, but these errors were encountered: