Comments (9)
Sorry it's taken me so long to get around to fixing this, however it's now been fixed in 4.0.1 which can be found on NuGet here. Decided to hold off on the above solution and instead just moved setting the status code before the log delegate is invoked. I'll close this issue now but please do let me know if there are any problems! 😄
from globalexceptionhandlerdotnet.
@dharanish @codecontemplator So it does! My test tests against a 500 which is why it was passing, I'll get that fixed.
from globalexceptionhandlerdotnet.
Hi @codecontemplator, thanks for raising this.
You can access the mapped status code via the httpContext argument (httpcontext.Response.StatusCode
).
Is this what you were looking for or have I misunderstood your question?
Thanks,
Joe
from globalexceptionhandlerdotnet.
Hi, @josephwoodward thanks for your reply.
when I try to access httpContext.Response.StatusCode it always gives me 500 internal server error.
Could you please tell me if I am missing something.
from globalexceptionhandlerdotnet.
I experience the same thing. It seems like the OnError (logger) is invoked before the status code is resolved.
from globalexceptionhandlerdotnet.
yeah @codecontemplator, I think _logger can be invoked after resolving status code.
from globalexceptionhandlerdotnet.
Thanks!
from globalexceptionhandlerdotnet.
Is it possible to provide any update on this issue.?
from globalexceptionhandlerdotnet.
@dharanish Yeah, working on a solution - hoping to get it out in the next few days. Ultimately I've created an overload that gives you some different options then I'll retire the older one ((Exception, HttpContext)
) in the next major version release.
from globalexceptionhandlerdotnet.
Related Issues (20)
- No 'Access-Control-Allow-Origin' header is present on the requested resource. HOT 4
- Do not restrict to return pre-defined http status codes HOT 3
- Unhandled exception log HOT 1
- any future plans for "problem+json"? HOT 3
- ASP.Net Core 2.1 Issue HOT 7
- Is This Repo Alive? HOT 2
- HTTP status code within exception HOT 15
- Add property to indicate whether the exception has handled or not
- Handling a specific exception in MVC Core 2.1 HOT 2
- Logging Session Id HOT 5
- Allow content negotiation in .ResponseBody() HOT 1
- OnError endpoint and exception map HOT 4
- Is it possible to add a non-generic method of Map<T>() ?
- Doesn't handle custom exceptions in net.core 3.1 HOT 8
- How to configure exception to error page
- Why I am not able to get the latest GlobalExceptionHandlerDotNet 4.0.3 from nuget
- can not handle api constructor exception
- Was v5 never released?
- How to handle the response in unit test cases?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from globalexceptionhandlerdotnet.