Skip to content

Handle return "validation" errors #256

Closed Answered by TheEdoRan
blechatellier asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, the server error shape is a global setting because all the actions share the same returned server error type. However, validation errors are determined by the schema you pass to the action you're defining, that's why it wouldn't make any sense to set an option at the global client level, other than a generic "flattened" | "formatted" default shape. The client is used to define all the actions of your application, there's just no way to know the specific schemas (and so, validation errors types) of all your actions at the top level of the hierarchy, it's impossible. Hope this clears things up!

Replies: 2 comments 9 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
9 replies
@MrOxMasTer
Comment options

@TheEdoRan
Comment options

@MrOxMasTer
Comment options

@MrOxMasTer
Comment options

@TheEdoRan
Comment options

Answer selected by TheEdoRan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants