How to use the @feathersjs/errors.errors 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 / feathers-hooks-common / lib / services / legacy-populate.js View on Github external
const feathersErrors = require('@feathersjs/errors');

const errors = feathersErrors.errors;

module.exports = function (target, options) {
  options = Object.assign({}, options);

  console.error(
    'Calling populate(target, options) is now DEPRECATED and will be removed in the future. ' +
    'Refer to docs.feathersjs.com for more information. (populate-legacy)'
  );

  if (!options.service) {
    throw new Error('You need to provide a service. (populate)');
  }

  const field = options.field || target;

  return function (hook) {