mirror of https://github.com/boxyhq/jackson.git
Error handling
This commit is contained in:
parent
e08671161d
commit
681cf9537e
|
@ -58,26 +58,22 @@ const reportEvent = async ({ action, crud, group, actor, description, productId
|
|||
|
||||
// Find team info for the product
|
||||
if (productId && !group) {
|
||||
try {
|
||||
const product = await productController.get(productId);
|
||||
const product = await productController.get(productId);
|
||||
|
||||
retracedEvent.group = {
|
||||
id: product.teamId,
|
||||
name: product.teamName,
|
||||
};
|
||||
retracedEvent.group = {
|
||||
id: product.teamId,
|
||||
name: product.teamName,
|
||||
};
|
||||
|
||||
retracedEvent.target = {
|
||||
id: product.id,
|
||||
name: product.name,
|
||||
};
|
||||
} catch (err: any) {
|
||||
console.error('Error getting product info. Event not reported to Retraced.', err);
|
||||
}
|
||||
retracedEvent.target = {
|
||||
id: product.id,
|
||||
name: product.name,
|
||||
};
|
||||
}
|
||||
|
||||
await retracedClient.reportEvent(retracedEvent);
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
console.error('Error reporting event to Retraced', error);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue