UNPKG

mares-apistore-message-error

Version:

apistore api호출시 필요한 error handling module 입니다.

31 lines (25 loc) 756 B
const utils = require('./utils'); const MaresError = require('mares-error'); /** * Mares Error Class. */ class MaresApistoreMessageError extends MaresError { /** * 에러 클래스 생성자 * @param {Error} input - 외부 error. * @param {string} type - error type */ constructor(input, type) { super(input); this.type = type; }; /** * @override * @returns {{status: number}|{status: number, body: {rows: {domain: string, code: string, param: string, msg: string}[], count: number}}} - 변환된 mares 객체. */ convert() { return utils.convert(this.type, this.input); } } MaresApistoreMessageError.codes = utils.codes; module.exports = MaresApistoreMessageError;