How to use the @feathersjs/errors.NotAcceptable function in @feathersjs/errors

To help you get started, we’ve selected a few @feathersjs/errors examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github feathersjs-ecosystem / rest-client / test / server.js View on Github external
get (id, params) {
    if (params.query.error) {
      throw new Error('Something went wrong');
    }

    if (params.query.feathersError) {
      throw new errors.NotAcceptable('This is a Feathers error', { data: true });
    }

    return super.get(id, params)
      .then(data => {
        const result = Object.assign({ query: params.query }, data);

        if (params.authorization) {
          result.authorization = params.authorization;
        }

        return result;
      });
  }
github feathersjs-ecosystem / feathers-objection / src / error-handler.js View on Github external
break;

      case 403:
        feathersError = new errors.Forbidden(error);
        break;

      case 404:
        feathersError = new errors.NotFound(error);
        break;

      case 405:
        feathersError = new errors.MethodNotAllowed(error);
        break;

      case 406:
        feathersError = new errors.NotAcceptable(error);
        break;

      case 408:
        feathersError = new errors.Timeout(error);
        break;

      case 409:
        feathersError = new errors.Conflict(error);
        break;

      case 422:
        feathersError = new errors.Unprocessable(error);
        break;

      case 501:
        feathersError = new errors.NotImplemented(error);