title: Can I use this simple try catch syntax?
body: <p>I'm using asp.net mvc 5.</p>
  
  <p>I used :</p>
  
  <pre><code>try
  {
     // some code of any type
  }
  catch (Exception e)
  {
      ViewBag.error = e.Message;
  }
  </code></pre>
  
  <p>I'm not using throw keyword and only I want to show the error in the view.</p>
  
  <p>is my syntax correct?</p>
  
  <p>thanks.</p>