title: How to handle validation messages returned by Sails JS?
body: <p>Hope you are doing great!!</p>
  
  <p>I am working on SailsJS web-app and using actions structure for controllers.</p>
  
  <p>This is my <code>user/login</code> action:</p>
  
  <pre><code>  module.exports = {
      friendlyName: 'Login',
  
      description: 'Login user.',
  
      inputs: {
        email: {
          description: 'user email.',
          type: 'string',
          required: true
        },
        password: {
          description: 'user password.',
          type: 'string',
          required: true
        }
      },
  
      exits: {
        success: {
          statusCode: 200,
          responseType: 'view',
        },       
      },
  
      fn: async function (inputs, exits) {
        // All done.
        return 'hello world';
      }
    };
  </code></pre>
  
  <p>This is the login form html code:</p>
  
  <pre><code>    &lt;div class="row"&gt;
        &lt;div class="valign-wrapper"&gt;
            &lt;div class="col s6 z-depth-4 card-panel"&gt;
              &lt;form class="col s12 login-form" method="POST" action="/login"&gt;
                &lt;input type="hidden" name="_csrf" value="&lt;%= _csrf %&gt;" /&gt;
                &lt;div class="card-content"&gt;
                  &lt;h5 class="card-title center-align"&gt;Login&lt;/h5&gt;
                  &lt;div class="row margin"&gt;
                    &lt;div class="input-field col s12"&gt;
                      &lt;input id="email" type="email" class="validate"&gt;
                      &lt;label for="email"&gt;Email&lt;/label&gt;
                      &lt;div class="invalid-feedback" v-if="formErrors.emailAddress"&gt;Please provide a valid email address.&lt;/div&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row margin"&gt;
                    &lt;div class="input-field col s12 right"&gt;
                      &lt;input id="password" type="password" class="validate"&gt;
                      &lt;label for="email"&gt;Password&lt;/label&gt;
                    &lt;/div&gt;
                  &lt;/div&gt;
                  &lt;div class="row"&gt;
                    &lt;button class="btn waves-effect waves-light right" type="submit" name="action"&gt;Login&lt;/button&gt;
                  &lt;/div&gt;            
                &lt;/div&gt;
              &lt;/form&gt;
            &lt;/div&gt;
          &lt;/center&gt;
        &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>Whenever, I am submitting blank form I get this following error:</p>
  
  <pre><code>    {
        "code": "E_MISSING_OR_INVALID_PARAMS",
        "problems": [
          "\"email\" is required, but it was not defined.",
          "\"password\" is required, but it was not defined."
        ],
        "message": "The server could not fulfill this request (`POST /login`) due to 2 missing or invalid parameters.  **The following additional tip will not be shown in production**:  Tip: Check your client-side code to make sure that the request data it sends matches the expectations of the corresponding parameters in your server-side route/action.  Also check that your client-side code sends data for every required parameter.  Finally, for programmatically-parseable details about each validation error, `.problems`. "
      }
  </code></pre>
  
  <p>Now, the issue is that I am unable to find a way to handle this error in prettier way.</p>
  
  <p>I hope one of you can guide me on the right path.</p>
  
  <p>Thank You,</p>