Closed harishrathi closed 4 years ago
Hmmm... So it looks like hte ResponseStream is not set when the error occurs which means either the error occurs before the Response has been initialized (ie. pre-controller from other middleware?) or the exception is wiping out the original response.
Do you know where the actual error that is going into the CustomExceptionMiddleware is triggered?
I'll double check and see if there's some way to effectively check to make sure the ResponseStream is actually available.
I've added additional null checks into the check routine that writes to the response stream, so that might help although I have a feeling this will push the issue up higher.
Give the 0.2.1
release a try and see if that fixes it. If not if you could create a small test project so I can see the exact issue you're describing that'd be helpful.
Also that said for API projects I'm not sure that LiveReload provides any benefit. Unless you have some sort of HTML content that needs to be redisplayed this Live Reload functionality isn't really useful. For server code reloads dotnet watch run
is all that should be needed.
Sorry, for raising the issue without full investigation. You are right, Live Reload is not really required for API project. I though the .net core dotnet watch run
does not watch for dependent project changes, hence I had added this package. But it seems that the build in dotnet watch run
does watch for changes in dependent projects.
Sorry once again.
Would be nice if you could still try this and see if the fix addressed the issue - other than updting the package nothing else should have to change in that same scenario.
Issue is resolved. Upgraded from 0.1.18 to 0.2.1. Thanks a lot for quick turnaround. I will try to submit a PR for next time.
Getting null reference exception
The custom exception handler is
My
.Net core 3.0
project is only for API and does not deal with MVC as such.