title: how to pass the error messages from back end(sails.js) to front end
body: <p>If i have to pass any message/error to front end , in sails.js.</p>
  
  <p>Either we can use one of the following below.</p>
  
  <pre><code>  1. res.view({error : error}) 
    2. res.view("/otherpageurl", {error : error})
    3. res.redirect("/otherpageurl?error="+error)
  </code></pre>
  
  <p>In some cases , If iam in page A , if any error occurs , i just want to redirect to another page with the error message passed to frontend.whereas in some cases , i just want to show the error in same page.</p>
  
  <p>Is there any other possiblity of passing error messages to frontend?</p>
  
  <p>Please help. Thanks a lot.</p>