Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionFactory for 404 #1153

Open
zh355245849 opened this issue Apr 15, 2021 · 0 comments
Open

ExceptionFactory for 404 #1153

zh355245849 opened this issue Apr 15, 2021 · 0 comments

Comments

@zh355245849
Copy link

Hi, guys,
How can I use the ExceptionFactory to override 404 code with null result? I have tried below but none of these can work, it always throw exception when code is not 404:
ExceptionFactory = httpResponse => httpResponse.StatusCode != HttpStatusCode.NotFound ? Task.FromResult<Exception?>(null) : (Task<Exception?>)Task.CompletedTask,

ExceptionFactory = httpResponse => httpResponse.StatusCode != HttpStatusCode.NotFound ? Task.FromResult<Exception?>(null) : null

Can someone guide me to the correct path?
Thanks,
Han

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant