Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7013487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:23:39+00:00 2026-05-27T22:23:39+00:00

.NET 4.0, C# I’m trying to add some exception management framework to my project.

  • 0

.NET 4.0, C#

I’m trying to add some exception management framework to my project. The framework publishes exceptions to a database if able.

I’ve done a good amount of research on exception handling but I’m having a bit of trouble understanding how I’m supposed to handle exceptions which occur inside event handlers (i.e. a timer.elapsed or an async callback). Should each event handler have a try catch block?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:23:40+00:00Added an answer on May 27, 2026 at 10:23 pm

    The event handler should always have a try..catch..finally block in its body to prevent the event handler from propagating the exception. Also, event handlers are expected to execute quickly so avoid performing expensive IO or database operations inside the event handler itself.

    Furthermore, you can have a property like Error to indicate to the subscribers of the event that an error has occurred (in case of an async call).

    More information

    • C# event fundamentals and exception handling in multicast delegates
    • top-level exception handling with event handlers in c#
    • Should C# event handlers be exception safe?
    • Async command pattern – exception handling
    • Best Practices for Implementing the Event-based Asynchronous Pattern
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

.NET Framework: 2.0 Preferred Language: C# I am new to TDD (Test Driven Development).
.NET, Java and other high level database API's in various language often provide techniques
.Net Compact Framework Scenario: User is on a screen. Device can't finds a printer
.NET has a lot of complex data structures. Unfortunately, some of them are quite
.NET balanced group regexes make my head explode. I've got this string i'm trying
.Net's implementation of HTTP is ... problematic. Beyond some issues in compliance with HTTP/1.0,
.NET 3.5, C# I have a web app with a search feature. Some of
.Net framework contains a great class named Convert that allows conversion between simple types,
net wizard, and im tryng to hide the next button on some cases. My
.NET Programming guidelines state that we should not catch general exceptions. I assume the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.