<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Exception handling on Fractalia</title><link>https://blog.fractalia.se/tags/exception-handling/</link><description>Recent content in Exception handling on Fractalia</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Tue, 16 Mar 2021 00:00:00 +0000</lastBuildDate><atom:link href="https://blog.fractalia.se/tags/exception-handling/index.xml" rel="self" type="application/rss+xml"/><item><title>Nasty exceptions in Timer scope</title><link>https://blog.fractalia.se/blog/nasty-exceptions-in-timer-scope/</link><pubDate>Tue, 16 Mar 2021 00:00:00 +0000</pubDate><guid>https://blog.fractalia.se/blog/nasty-exceptions-in-timer-scope/</guid><description>TL; DR Unhandled exceptions occurring in Timer scope in a .Net Core application will crash the application without any logs or any graceful shutdown. Make sure to catch any exceptions in Timer scope and handle them without rethrowing.
Timer scope With Timer scope I refer to any method that is set to execute when a Timer fires. Typically the code would look something like this:
var timer = new System.Threading.Timer(MethodInTimerScope); .</description></item></channel></rss>