Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api-log): handle error on log insert #4488

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(api-log): handle error on log insert
  • Loading branch information
brunozoric committed Jan 14, 2025
commit c4971972f93a41c9e9dc3cbba95fe5ab2ac673ef
12 changes: 9 additions & 3 deletions packages/api-log/src/logger/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,15 @@ export const loggerFactory = ({ getTenant, getLocale, documentClient }: ILoggerF
return {
logger: createDynamoDbLogger({
onFlush: async items => {
return await storageOperations.insert({
items
});
try {
return await storageOperations.insert({
items
});
} catch (ex) {
console.error("Error flushing logs.");
console.log(ex);
}
return [];
},
getLocale,
getTenant
Expand Down