moleculer-db icon indicating copy to clipboard operation
moleculer-db copied to clipboard

export Errors as property

Open pibi opened this issue 4 years ago • 1 comments

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;

pibi avatar Sep 24 '21 10:09 pibi

Good idea, could you create a PR?

icebob avatar Sep 25 '21 11:09 icebob