© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
1 reply
surwren

Proper C multicatch syntax

I saw in Java that you can do multicatch blocks (see image)

I also looked it up on stackoverflow:

https://stackoverflow.com/questions/136035/catch-multiple-exceptions-at-once

However there seems to be several methods listed in the thread.

What's the c# convention for multicatch blocks?
Screenshot_20220905-183142.jpg
Stack Overflow
Catch multiple exceptions at once?
It is discouraged to simply catch System.Exception. Instead, only the "known" exceptions should be caught.
Now, this sometimes leads to unnecessary repetitive code, for example:
try
{
...
Catch multiple exceptions at once?
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

✅ What syntax for c#?
C#CC# / help
2y ago
Proper syntax (or usage) for unsigned int
C#CC# / help
4y ago
JavaScript Framework with C# syntax
C#CC# / help
2y ago
Syntax for c# to do this?
C#CC# / help
2y ago