Skip to content

Commit

Permalink
fix error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
smalho01 committed Jan 15, 2025
1 parent 2c4c83a commit 0fc86e7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/hooks/hookResources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ export async function handleHook(
data: hook,
timeout: 5000,
};
try {
console.log(url); //zzzz
const response = axios(url, options);
response.then(e => {
res.json(e.data);
});
} catch (err) {

console.log(url); //zzzz
const response = axios(url, options);
response.then(e => {
res.json(e.data);
})
.catch(err => {
console.log('zzzz: error in forwardData call:');
console.log(err);
res.json({ cards: [] });
}
res.json({ cards: [] }); // Return fallback response
});
};
if (drugCode) {
const hook: Hook = req.body;
Expand Down

0 comments on commit 0fc86e7

Please sign in to comment.