Skip to content

Commit

Permalink
fix: handle failed connection to host
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffreyArt1 committed Sep 28, 2024
1 parent 5ab394b commit 7df662d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/actions/iam.action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ async function findAccountInBackoffice(cedula: string) {
const url = new URL('v1/accounts', process.env.BACKOFFICE_API_URL);
url.searchParams.append('term', cedula);

const resp = await fetch(url, withCredentials());
const resp = await fetch(url, withCredentials()).catch((e) => ({
ok: false,
json: () => Promise.resolve(e.cause),
}));

if (resp.ok) {
return resp
Expand Down

0 comments on commit 7df662d

Please sign in to comment.