This commit is contained in:
Luiz H. R. Silva 2024-06-27 11:39:13 -03:00
parent cd3d686ecb
commit 5e75cd641a
6 changed files with 49 additions and 25 deletions

View file

@ -36,11 +36,11 @@ export const gerarRespostas = (
/** Faz um processamento quando erro interno
* Recebe o erro gerado, mensagem personalizada e detalhes
*/
registrarErroInterno: (
erro: any,
mensagem?: string,
detalhes?: string[],
) => Partial<tipoRespostaErro>,
registrarErroInterno: (op: {
erro: any
mensagem?: string
local: string
}) => Partial<tipoRespostaErro>,
) => {
const valor = <T>(valor: T, detalhes?: string[]): tipoRespostaSucesso<T> => {
return {
@ -105,14 +105,14 @@ export const gerarRespostas = (
}
}
const erroInterno = (
erro: any,
mensagem?: string,
detalhes?: string[],
): tipoRespostaErro => {
const resRegistro = registrarErroInterno(erro, mensagem, detalhes)
const erroInterno = (op: {
erro: any
mensagem?: string
local: string
}): tipoRespostaErro => {
const resRegistro = registrarErroInterno(op)
const mensagemFim = `${mensagem || "Erro interno"}`
const mensagemFim = `${op.mensagem || "Erro interno"}`
return {
cod: codigosResposta.erroDesconhecido,