© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
12 replies
Thalnos

❔ 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){}
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ Weird WPF exception
C#CC# / help
3y ago
✅ Deploying WPF APP
C#CC# / help
2y ago
SVG Icon in a wpf App
C#CC# / help
11mo ago