ecyrbe / zodios

typescript http client and server with zod validation

Home Page:https://www.zodios.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Is there any way to catch all ZodiosErros like Axios interceptors do?

lucas-santosP opened this issue · comments

I was trying to achieve this with plugins but with no success, neither response nor error middlewares caught that.

The use case for that would be to show a user-friendly error message for all schemas validation errors. Since this is not something the user must know what exactly causes, so I was planning to show a generic error message to all ZodiosErros.

And in this case, I'm using only Zodios client because the API is built with C# so I don't have a complete guarantee that the responses will always be matching my schema definition.

commented

Hello,
not with current version. as validation is made as a plugin itself. And has higher priority.

But v11 has hability to have custom higher priority