Effect CommunityEC
Effect Community2y ago
3 replies
Stephen Bluck

End-to-End Type Inference with Error Handling in Remix

Got end to end types being inferred from server -> client including errors in Remix now. This screenshot returns a ValidationError which is the form validation logic such as "Invalid email address" etc I can use these to render inline input error messages. The CredentialsNotRecognised is a domain error that I have chosen to send to the front end for it to deal with there. It can be used to show an error message that doesn't directly correlate to an input field.

I can also return various other types of errors like NotFound, Unauthorised, Unexpected which will sit in the error channel and will render the ErrorBoundry component in Remix.
Screenshot_2024-05-06_at_21.40.31.png
Was this page helpful?