Try - Catch return strategy 
<p>When using <code>try-catch</code> in methods, if you want you application to continue even if errors come along, is it okay to return the default value as return through the catch block, and log the error for later review?</p>

<p>For Example:</p>

<pre><code>public static string GetNameById(int id)
{
    string name;
    try
    {
        //Connect to Db and get name - some error occured
    }
    catch(Exception ex)
    {
        Log(ex);
        name = String.Empty;
    }

    return name;
}
</code></pre>

<p>Example 2:</p>

<pre><code>public static string GetIdByName(string name)
{
    int id;
    try
    {
        //Connect to Db and get id- some error occured
    }
    catch(Exception ex)
    {
        Log(ex);
        id = 0;
    }

    return id;
}
</code></pre>

<p>Is it okay to return any default value (depending on the return type of the method ...???) so that the application logic that required the result from this method do not crash and keeps going ....</p>

<p>Thanks in advance...</p>

<p>Regards.</p>
