build
This commit is contained in:
parent
d0808a86dc
commit
ef9b4c746c
4 changed files with 33 additions and 4 deletions
|
|
@ -105,7 +105,17 @@ class ClassPilao {
|
|||
body: JSON.stringify({ tabela, registros: bloco }),
|
||||
headers: { "Content-Type": "application/json" },
|
||||
})
|
||||
.then((r) => r.json())
|
||||
.then(async (r) => {
|
||||
try {
|
||||
return await r.json();
|
||||
}
|
||||
catch {
|
||||
return respostaComuns.erro("Consulta não retornou json válido", [
|
||||
await r.text(),
|
||||
r.statusText,
|
||||
]);
|
||||
}
|
||||
})
|
||||
.catch((e) => respostaComuns.erro(`Erro ao ${acao} registros`, [e.message]));
|
||||
if (resp.eErro)
|
||||
return resp;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue