How do I throw and exception using `if` and `else` if the user enter something that isn't a valid integer?
<p>I'm writing a program that adds numbers. The program takes input from the user as an integer value and gives him a total of both numbers. But I want that when the user enters any character besides the number, a custom error is written to the console. How do you do that with <code>if</code> and <code>else</code>?</p>

<p>My code:</p>

<pre><code>class Program
{
    static void Main(string[] args)
    {
        double firstnum, secondnum, total;

        Console.WriteLine("FIRST NUMBER");
        firstnum = Convert.ToDouble(Console.ReadLine());
        if (Console.ReadLine == char)
        {
            Console.WriteLine("error... error wrong keyword, enter only numbers...");
        }

        Console.WriteLine("SECOND NUMBER");
        secondnum = Convert.ToDouble(Console.ReadLine());

        total = firstnum + secondnum;
        Console.WriteLine("TOTAL VALUE IS =" + total);

        Console.ReadLine();
</code></pre>
