moleculerjs/moleculer-db

export Errors as property

pibi opened this issue · 1 comments

pibi commented

For consistency's sake the Errors should be available from the export just like the moleculer and moleculer-web modules. No need to have this:

const { ValidationError } = require("moleculer").Errors;
const { NotFoundError } = require("moleculer-web").Errors;
const { EntityNotFoundError } = require("moleculer-db/src/errors");

but instead:

const { ValidationError } = require("moleculer").Errors;
const { NotFoundError } = require("moleculer-web").Errors;
const { EntityNotFoundError } = require("moleculer-db").Errors;

Good idea, could you create a PR?