Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

Catching EXCEPTIONS with custom messages in C#

You can write your own custom error message instead of allowing the compiler's error message.

Example:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;

namespace ForgetCode
{
    class Program
    {
       static void Main(string[] args)
        {
            int top = 0, bottom = 0, result = 0;
            try
            {
                result = top / bottom;
            }
            catch (System.DivideByZeroException ex)
            {
                
                // Custom message for easy understanding

                Console.WriteLine("You have attempted to divide a number with zero");
            }
           
        }
    }
}

Output:
You have attempted to divide a number with zero