build
This commit is contained in:
parent
dae11465e9
commit
cd3d686ecb
6 changed files with 38 additions and 19 deletions
|
|
@ -10,7 +10,11 @@ var codigosResposta;
|
|||
codigosResposta[codigosResposta["erroDesconhecido"] = 500] = "erroDesconhecido";
|
||||
codigosResposta[codigosResposta["tempoEsgotado"] = 504] = "tempoEsgotado";
|
||||
})(codigosResposta || (exports.codigosResposta = codigosResposta = {}));
|
||||
const gerarRespostas = (registrarErroInterno) => {
|
||||
const gerarRespostas = (
|
||||
/** Faz um processamento quando erro interno
|
||||
* Recebe o erro gerado, mensagem personalizada e detalhes
|
||||
*/
|
||||
registrarErroInterno) => {
|
||||
const valor = (valor, detalhes) => {
|
||||
return {
|
||||
cod: codigosResposta.sucesso,
|
||||
|
|
@ -62,8 +66,8 @@ const gerarRespostas = (registrarErroInterno) => {
|
|||
detalhes,
|
||||
};
|
||||
};
|
||||
const erroInterno = (parametros, mensagem) => {
|
||||
const resRegistro = registrarErroInterno(parametros);
|
||||
const erroInterno = (erro, mensagem, detalhes) => {
|
||||
const resRegistro = registrarErroInterno(erro, mensagem, detalhes);
|
||||
const mensagemFim = `${mensagem || "Erro interno"}`;
|
||||
return {
|
||||
cod: codigosResposta.erroDesconhecido,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue