Skip to content

Add missing last line in Exception trace capture #58

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

Merged
merged 2 commits into from
Apr 1, 2022

Conversation

yann-eugone
Copy link
Contributor

@yann-eugone yann-eugone commented Apr 1, 2022

Throwable::getTraceAsString method do not include the line where the exception is thrown.
This PR is adding this information to the captured stacktrace when converting Exceptions to Failures.

Now, traces will be something like

Exception: Thrown from class C (at /in/uVj23(43))
#0 /in/uVj23(35): C->exc()
#1 /in/uVj23(50): C->doexc()
#2 /in/uVj23(54): fail2()
#3 /in/uVj23(58): fail1()
#4 {main}
Caused by: Exception: Thrown from class B (at /in/uVj23(29))
#0 /in/uVj23(40): B->exc()
#1 /in/uVj23(35): C->exc()
#2 /in/uVj23(50): C->doexc()
#3 /in/uVj23(54): fail2()
#4 /in/uVj23(58): fail1()
#5 {main}

@codecov
Copy link

codecov bot commented Apr 1, 2022

Codecov Report

Merging #58 (94c1ac8) into 0.x (ee11d80) will not change coverage.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##                 0.x       #58   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity       714       717    +3     
===========================================
  Files            121       121           
  Lines           1820      1827    +7     
===========================================
+ Hits            1820      1827    +7     
Impacted Files Coverage Δ
src/batch/src/Failure.php 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ee11d80...94c1ac8. Read the comment docs.

@yann-eugone yann-eugone force-pushed the add-missing-element-in-stack-trace branch 2 times, most recently from ffc7836 to 47d3ed7 Compare April 1, 2022 13:52
@yann-eugone yann-eugone force-pushed the add-missing-element-in-stack-trace branch from 47d3ed7 to 94c1ac8 Compare April 1, 2022 13:56
@yann-eugone yann-eugone merged commit e482265 into 0.x Apr 1, 2022
@yann-eugone yann-eugone deleted the add-missing-element-in-stack-trace branch May 14, 2022 07:59
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.

1 participant