title: How to create customized error with custom error options in restify 7.x?
body: <p>I would like to create some customized errors in a project, using <strong>restify</strong> (version 7.x) with custom error options. Now I'm able to create a customized error with parameters code and message using <a href="https://www.npmjs.com/package/restify-errors" rel="nofollow noreferrer">restify-errors</a>. And I tried to create an error with more than two params using the <a href="https://www.npmjs.com/package/restify-errors#subclassing-errors" rel="nofollow noreferrer">subclassing property</a> of <strong>restify-errors</strong> using the <code>makeConstructor()</code>. </p>
  
  <pre><code>restifyErrors.makeConstructor('ValidationError', {
       restCode: 'ValidationError',
      statusCode: 400,
      message: message
  });
  var myErr = new errors.ValidationError();
  </code></pre>
  
  <p>But I can't implement it successfully, ended up with the below-shown error</p>
  
  <blockquote>
    <p>var myErr = new errors.ValidationError();
                    ^</p>
    
    <p>TypeError: errors.ValidationError is not a constructor</p>
  </blockquote>
  
  <p>And also, I tried <a href="https://www.npmjs.com/package/restify-errors-options" rel="nofollow noreferrer">restify-error-options</a> it also wouldn't work for me.
  Can anyone suggest a solution to this problem or suggest me how to implement customized errors with custom error options?</p>