@4alltecnologia/http-errors 中文文档教程
@4alltecnologia/http-errors
Description
一个错误模块,用于标准化项目内的错误使用
Installation
安装前,下载并安装 Node.js。 需要 Node.js 8 或更高版本。
使用 npm install
命令 完成安装。
npm install @4alltecnologia/http-erros
Usage
const http_errors = require('@4alltecnologia/http-errors');
const error = new http_errors.BadRequest('Some error message');
console.log(error) // { message: 'Some error message', code: 'BAD_REQUEST' }
@4alltecnologia/http-errors
Description
An error module to standarize error usage inside a project
Installation
This is a Node.js module availale through npm.
Before installing, download and install Node.js. Node.js 8 or higher is required.
Installation is done by using the npm install
command.
npm install @4alltecnologia/http-erros
Usage
const http_errors = require('@4alltecnologia/http-errors');
const error = new http_errors.BadRequest('Some error message');
console.log(error) // { message: 'Some error message', code: 'BAD_REQUEST' }