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

catch and swallow exceptions on fetch #103

Merged
merged 5 commits into from Jan 31, 2023
Merged

Conversation

schehata
Copy link
Collaborator

while sending logs exceptions could happend, swallowing the exception ensures we don't interrupts customer apps or break api functions responses. We do the same in web-vitals. I am not sure though about removing await, need to think about it and do some testing.

while sending logs exceptions could happend, swallowing the exception
ensures we don't interrupts customer apps or break api functions
responses. We do the same in web-vitals.
@vercel
Copy link

vercel bot commented Jan 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
next-axiom-example ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 27, 2023 at 10:08AM (UTC)

@oranoran
Copy link

LGTM.

Regarding the idea of removing await - from previous testing I've done on Vercel, it looks like it's ok to keep running after sending a response. The only limit to this is the function timeout.
I didn't test this on platforms other than Vercel.

Copy link
Member

@bahlo bahlo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm a bit concerned about deliverability if we don't await, otherwise nice work ✌️

@schehata
Copy link
Collaborator Author

LGTM.

Regarding the idea of removing await - from previous testing I've done on Vercel, it looks like it's ok to keep running after sending a response. The only limit to this is the function timeout. I didn't test this on platforms other than Vercel.

would the function wait for the fetch to finish if we don't await ? that's basically our concern.

@schehata
Copy link
Collaborator Author

removing await seems not to change anything, the logs still arrives safely, but I am not sure about the execution time yet, but it seems to be better than sending the logs with await. will merge this for now, and continue testing other scenarios.

@schehata schehata merged commit 8f274f1 into main Jan 31, 2023
@schehata schehata deleted the catch-flush-errors-on-logs branch January 31, 2023 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants