Steven Giesel 3/24/2023

Leverage 'is not' Operator for Exception Filtering!

Read Original

This technical article demonstrates a C# programming technique for improving exception handling. It shows how to use the 'is not' operator within an exception filter (catch...when) to elegantly exclude specific exception types, like OperationCanceledException, from being logged, resulting in more readable and maintainable code.

Leverage 'is not' Operator for Exception Filtering!

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week