Skip to content

Handle errors in auto-tracing better - #610

Merged
alexmojaki merged 6 commits into
mainfrom
alex/auto-trace-errors
Nov 20, 2024
Merged

alexmojaki merged 6 commits into
mainfrom
alex/auto-trace-errors

Conversation

@alexmojaki

@alexmojaki alexmojaki commented Nov 19, 2024 •

Copy link
Copy Markdown
Contributor
  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.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 19, 2024 •

Copy link
Copy Markdown

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

@codecov

codecov Bot commented Nov 19, 2024 •

Copy link
Copy Markdown

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"

@davidhewitt davidhewitt left a comment

Copy link
Copy Markdown
Contributor

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
@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