UNPKG

bipbop-webservice

Version:

Chamada aos serviços da BIPBOP via NodeJS ou pelo navegador.

20 lines (15 loc) 583 B
import ErrorCodes from './error-codes'; export default class BIPBOPException extends Error { public push: boolean | undefined; public code: ErrorCodes | undefined; constructor(msg: string | undefined) { super(msg); Object.setPrototypeOf(this, BIPBOPException.prototype); } static factory(message?: string | undefined, code: ErrorCodes = ErrorCodes.E_UNKNOWN, push: boolean = false) : BIPBOPException { const exception = new this(message); exception.code = code; exception.push = push; return exception; } }