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

feat: uniform rendering of stack trace from failed DB operations #9364

Draft
wants to merge 2 commits into
base: 4.6
Choose a base branch
from

Conversation

paulbalandan
Copy link
Member

Description
Closes #9338

All DB drivers except SQL Server logs (with 'error' level) a full stack trace of any failed DB executions via the thrown exception. For SQL Server, the log only includes the message produced by sqlsrv_errors(). Moreover, there's inconsistency with regard to Postgre and OCI8 drivers. Since pg_query() and oci8_execute() only throws because of our error handler, the stack trace also includes the error handler (the [internal function] stack).

This PR aims to make consistent the log output of these drivers by using the same trace rendering. This is already achieved by the private Exceptions::renderBacktrace() method for the thrown exceptions, so this PR extracts it to a new function render_backtrace and uses that to format the trace. Also, trace coming from the error handler are removed.

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@paulbalandan paulbalandan added enhancement PRs that improve existing functionalities 4.6 labels Jan 2, 2025
@paulbalandan paulbalandan force-pushed the render-backtrace branch 3 times, most recently from 888f0ce to f60782b Compare January 2, 2025 18:52
@paulbalandan paulbalandan marked this pull request as draft January 2, 2025 19:14
@michalsn
Copy link
Member

michalsn commented Jan 3, 2025

The last time I checked, the full stack track was available: #9338 (comment) and it looks the same for all the drivers.

Are there any differences (I may have missed something)? Can you give me an example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.6 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants