-
-
Notifications
You must be signed in to change notification settings - Fork 185
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
[Bug] exception not catched into the modal component #270
Comments
I can't think of how the modal is blocking you getting exceptions in your handler. We don't have any try.. catch blocks in our code which could swallow the exception and threads are not an issue as there is only one thread in the browser. I've not done any work with logging in Blazor so I'm not familiar with the patterns or any pitfalls/shortcomings. This is something I will be looking into but I'm afraid I don't have the capacity to do it right now. @larsk2009 do you have any ideas on this one? |
Not really. I don't have much experience with this either. I guess the easiest way to see the issue is if we have an actual project which shows this issue. Then we can debug that project and probably find what is going on? |
Thank you, here an example of my project => https://github.com/adrienbarde/UnhandledExceptionWithBlazoredModal where the exception must be caught Into this file, there are two examples both throw exceptions the exception coming from "DeleteAgency" is caught ** how to test ** |
Hi @adrienbarde I can reproduce your issue with that project. I don't immediately see the issue, but have you had a look at this. It seems logging/exception handling/catching in Blazor is not very mature yet, so maybe something is just going wrong there? |
ok thank your help, i will migrate to 5.0.0-preview2, it seems to be resolve my issue |
It seems like this has been solved, so I will close this issue. If it isn't fixed yet, let us know! |
Describe the bug
I use a ilogger global exception handler and I call services from my component which is in my modal.
when a service throws an exception I can't catch it from my global handler.
it works fine all the application except for the exceptions of the services called by my component in the modal
Is there a way to catch the exception that thrown inside the modal? Is it a different thread? A cascading problem?
** Code **
My Ilogger
Program init
App.razor
Method to open the modal
My Edit component into the modal
The text was updated successfully, but these errors were encountered: