Skip to content

SafeActionResult returns undefined #175

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

You must be logged in to vote

By default every server error gets caught by the library and a serverError is returned. The only exception is for Next.js navigation errors, which are instead caught by the framework. If you use redirect the result will be undefined. TypeScript cannot infer a never return, so the safest way for the end user is to type the result as object | undefined, as it is right now.

Replies: 5 comments 16 replies

Comment options

You must be logged in to vote
5 replies
@ScreamZ
Comment options

@TheEdoRan
Comment options

Answer selected by ScreamZ
@ScreamZ
Comment options

@TheEdoRan
Comment options

@ScreamZ
Comment options

Comment options

You must be logged in to vote
5 replies
@laurent512
Comment options

@laurent512
Comment options

@TheEdoRan
Comment options

@laurent512
Comment options

@hannanstd
Comment options

Comment options

You must be logged in to vote
5 replies
@TheEdoRan
Comment options

@VirtuaBoza
Comment options

@eug-vs
Comment options

@TheEdoRan
Comment options

@eug-vs
Comment options

Comment options

You must be logged in to vote
1 reply
@ScreamZ
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
9 participants