@aex/errors
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Build Status Coverage Status MIT license

@aex/errors

import { AexErrors } from "@aex/errors";
import { Aex } from "@aex/core";
import * as path from "path";

const aex = new Aex();
const dirName = path.resolve(__dirname, "./errors");
const middleware = AexErrors(dirName, false);
aex.use(middleware);
aex.use(async (_req: any, res, scope: any) => {
  const { errors } = scope.outer;
  const { UserNotFound, PasswordNotFound } = errors;
  throw new UserNotFound("zh-CN");
  throw new UserNotFound("en-US");
  res.end("ok");
});

Readme

Keywords

Package Sidebar

Install

npm i @aex/errors

Weekly Downloads

2

Version

0.1.0

License

MIT

Unpacked Size

6.14 kB

Total Files

5

Last publish

Collaborators

  • calidion