title: How to rethrow an exception and return a value in c#?
body: <p>Given the following code, how can I return some value (DateTime.Now.ToString()) if the exception is thrown?</p>
  
  <pre><code>public string DateToString(int year, int month, int day)
  {
      try
      {
          DateTime datetime = new DateTime(year, month, day);
          return datetime.ToString();
      }
      catch (Exception)
      {
          //log error and rethrow
          throw;
      }
  }
  </code></pre>