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

AgaviException::getFixedTrace() should also fix traces with a missing file entry #1572

Closed
thomasbachem opened this Issue Jan 12, 2016 · 0 comments

Comments

Projects
None yet
1 participant
@thomasbachem
Contributor

thomasbachem commented Jan 12, 2016

When throwing an Exception in a fatal error scenario, PHP strips the stack trace.

With the current implementation, AgaviException::getFixedTrace() doesn't even add file and line from the Exception to the trace in that situation, because it checks for isset($fixedTrace[0]['file']) in

if(isset($fixedTrace[0]['file']) && !($fixedTrace[0]['file'] == $e->getFile() && $fixedTrace[0]['line'] == $e->getLine())) {

We should change that check to

if(!isset($fixedTrace[0]['file']) || !($fixedTrace[0]['file'] == $e->getFile() && $fixedTrace[0]['line'] == $e->getLine())) {

Because it seems pointless to not add file and line to otherwise completely empty traces.

thomasbachem added a commit that referenced this issue Jan 12, 2016

Make getFixedTrace() also fix traces without file #1572
AgaviException::getFixedTrace() now also fixes empty traces and traces with a missing file entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment