code: function parseOptions(ctorArgs) {
      function parse() {
        let options = null;
  
        if (_.isPlainObject(arguments[0])) {
          // See https://github.com/restify/errors#new-erroroptions--printf-args
          options = arguments[0] || {};
        } else if (
          arguments[0] instanceof Error &&
          _.isPlainObject(arguments[1])
        ) {
          // See https://github.com/restify/errors#new-errorpriorerr-options--printf-args
          options = arguments[1] || {};
        }
        return options;
      }
  
      // Calls constructor args.
      return parse.apply(null, ctorArgs);
    }
docs: Parse errror's arguments to extract the 'options' object.
  Extracted from https://github.com/restify/errors/blob/master/lib/helpers.js#L30
  @param  {} ctorArgs Arguments of the error.