❔ Exception hadnling in WPF App
I have an app that is being used as a TicketSystem. It monitors incoming calls and tickets for our Agents and lets the agents interact with those.
The calls are being queried from DB using Ado.Net Types (SqlConnection, SqlCommand)
The tickets are being queried from external api using HttpClient
Currently When there is an exception trying to get the calls or trying to get the tickets I display "Error, data couldn't be loaded" where I would otherwise display the respective DataGrid
using a regular
catch(Exception ex){}
block
One common scenario that made our App crash before we had this catch block was when the Agent is in his home office and doesn't have his VPN turned on to access company ressources.
Now I wonder whether I can catch a more specific exception, so that I can render "Make sure your VPN is turned on to access the company ressources" or smth like that.9 Replies
Sure, look at the actual runtime type of the exception caught
then add another catch for that type, before the
Exception
oneI sadly don't have access to it. We don't have logging implemented yet, and the user who faced this issue doesn't remember any detail information on the Exeption
can you simulate it yourself somehow?
will try
thx
also, you really should add logging 😄
ye I will 😄 its pretty fresh project
Serilog ❤️
definetly
into Azure App Insights 😊
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.