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

Handle errors in auto-tracing better #610

Merged
merged 6 commits into from
Nov 20, 2024
Merged

Conversation

alexmojaki
Copy link
Contributor

@alexmojaki alexmojaki commented Nov 19, 2024

  1. When a file has invalid syntax, skip auto-tracing so that it can be imported normally and produce a normal traceback.
  2. Handle internal errors when modifying and compiling the AST so that the app still works and just logs an error about auto-tracing failing.

For both of these, compiling had to be moved from the import loader to the import finder.

Copy link

cloudflare-workers-and-pages bot commented Nov 19, 2024

Deploying logfire-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2d3276c
Status: ✅  Deploy successful!
Preview URL: https://2cb3a15b.logfire-docs.pages.dev
Branch Preview URL: https://alex-auto-trace-errors.logfire-docs.pages.dev

View logs

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (b9f37ee) to head (2d3276c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #610   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          133       133           
  Lines        10556     10561    +5     
  Branches      1450      1450           
=========================================
+ Hits         10556     10561    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

…p> so that logging internal errors shows where the import happened"
Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

Looks like good improvements to me 👍

@alexmojaki alexmojaki enabled auto-merge (squash) November 20, 2024 11:06
@alexmojaki alexmojaki merged commit 43ba1e0 into main Nov 20, 2024
12 checks passed
@alexmojaki alexmojaki deleted the alex/auto-trace-errors branch November 20, 2024 11:08
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.

2 participants