Page MenuHomePhabricator

Automatically compile aggregate stack traces for complex exceptions
ClosedPublic

Authored by epriestley on May 25 2015, 3:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, May 7, 10:50 AM
Unknown Object (File)
Sat, May 4, 6:19 PM
Unknown Object (File)
Mon, Apr 29, 6:57 AM
Unknown Object (File)
Wed, Apr 24, 10:26 PM
Unknown Object (File)
Wed, Apr 17, 9:05 PM
Unknown Object (File)
Fri, Apr 12, 2:13 AM
Unknown Object (File)
Mar 29 2024, 11:11 PM
Unknown Object (File)
Mar 10 2024, 7:40 PM
Subscribers

Details

Summary

Fixes T8156. I think this is a little simpler/cleaner than D12796 + D12851?

Test Plan

With --trace:

[2015-05-25 08:28:38] EXCEPTION: (PhutilAggregateException) Some linters failed:
    - Exception: QUACK QUACK QUACK at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:275]
arcanist(head=master, ref.master=9b7c6786cdc9), phutil(head=master, ref.master=65819efa43f1)
  #0 <#2> ArcanistPhutilXHPASTLinter::lintRaggedClasstreeEdges(XHPASTNode) called at [<arcanist>/src/lint/linter/ArcanistPhutilXHPASTLinter.php:269]
  #1 <#2> call_user_func(array, XHPASTNode) called at [<arcanist>/src/lint/linter/ArcanistPhutilXHPASTLinter.php:120]
  #2 <#2> ArcanistPhutilXHPASTLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34]
  #3 <#2> ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:602]
  #4 <#2> ArcanistLintEngine::executeDidLintOnPaths(ArcanistPhutilXHPASTLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:553]
  #5 <#2> ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:481]
  #6 <#2> ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:219]
  #7 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:331]
  #8 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:387]

Without --trace:

Exception
Some linters failed:
    - Exception: QUACK QUACK QUACK
(Run with `--trace` for a full exception trace.)

Diff Detail

Repository
rPHU libphutil
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Automatically compile aggregate stack traces for complex exceptions.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: joshuaspence.

Particularly, I like that this approach:

  • merges identical stack frames when possible, to reduce the total number of frames shown and make the output look relatively regular; and
  • makes it fairly obvious what you should copy/paste, hopefully reducing the chance that we get bug reports with one uninteresting stack trace and none of the actual relevant details.
joshuaspence edited edge metadata.

I tested this with multiple exceptions being thrown:

[2015-05-25 21:01:22] EXCEPTION: (PhutilAggregateException) Some linters failed:
    - Exception: woof
    - Exception: quack at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:275]
arcanist(head=master, ref.master=4c208cec1608), phutil(head=master, ref.master=c89486b75a24)
  #0 <#3> ArcanistXHPASTLinter::resolveFuture(string, ExecFuture) called at [<arcanist>/src/lint/linter/ArcanistFutureLinter.php:34]
  #1 <#3> ArcanistFutureLinter::didLintPaths(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:602]
  #2 <#3> ArcanistLintEngine::executeDidLintOnPaths(ArcanistXHPASTLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:553]
  #3 <#2> ArcanistTextLinter::lintPath(string) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:585]
  #4 <#2> ArcanistLintEngine::executeLinterOnPaths(ArcanistTextLinter, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:543]
  #5 <#2> ArcanistLintEngine::executeLintersOnChunk(array, array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:481]
  #6 <#2> ArcanistLintEngine::executeLinters(array) called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:219]
  #7 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:331]
  #8 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:382]

Personally I think that the ordering is a little odd (particularly the dual numbering), but it's an improvement. I also think that D12851 is maybe still worthwhile because it seems odd to me that overriding the __toString() method doesn't change the output.

src/error/PhutilErrorHandler.php
533

Or even list<map<string, wild>>

547

Breadth-first order

554

I dislike the use of parentheses here, but eh.

560

Also here.

This revision is now accepted and ready to land.May 25 2015, 9:04 PM
This revision was automatically updated to reflect the committed changes.