-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Error line numbers coming out with invalid values #11234
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
Conversation
Kudos, SonarCloud Quality Gate passed!
|
Codecov Report
@@ Coverage Diff @@
## master #11234 +/- ##
==========================================
- Coverage 61.37% 61.08% -0.30%
==========================================
Files 604 601 -3
Lines 33528 33108 -420
Branches 4746 4678 -68
==========================================
- Hits 20577 20223 -354
+ Misses 11894 11865 -29
+ Partials 1057 1020 -37
Continue to review full report at Codecov.
|
Sorry got wrapped up in the bug bash. I can look early monday. |
let sourceLines = ''; | ||
const regex = /(;32m[ ->]*?)(\d+)(.*)/g; | ||
for (let l = regex.exec(traceFrame); l && l.length > 3; l = regex.exec(traceFrame)) { | ||
const newLine = stripAnsi(l[3]).substr(1); // Seem to have a space on the front |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comments like this make me worry this is a bit fragile of a process. But I don't see a way around it, so it might just be what we have to do.
For #10708
Number of problems here.
Old code assumed that if the file in the error message matched the cell, it was the cell. This doesn't work if the exception is thrown in a different cell that's been referenced (as it will have the same file). The example for this is in the bug.
Old code also didn't take into account extra spacing at the top of a cell.
New code uses the cell hash provider to look for the closest match to the source code in the stack trace (if the file matches a file that we ran cells from).
Note that this may find invalid cells if they have duplicate code in them. Don't see a way around this without getting rid of the
__file__
support. An exception doesn't log any other information other than the code in the traceback.