aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/command/status_command.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-08 22:37:08 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 00:14:09 +0900
commitc74f4314853c0e7283691fdd4d0dec27c1199537 (patch)
tree2dd1c0a593498da1ac38cd1e61a92cce6dc78aa5 /crates/shirabe/src/command/status_command.rs
parentf4cad2123b2af0de72bda4ce039e16e74f163f4e (diff)
downloadphp-shirabe-c74f4314853c0e7283691fdd4d0dec27c1199537.tar.gz
php-shirabe-c74f4314853c0e7283691fdd4d0dec27c1199537.tar.zst
php-shirabe-c74f4314853c0e7283691fdd4d0dec27c1199537.zip
fix(exception): carry PHP's $previous through the ported throw sites
Composer hands the exception it caught to the one it throws in its place, so `getPrevious()` reaches the cause and Application's renderer prints the whole chain. Every ported site dropped it, because the flat exception structs had nowhere to put one. `AnyThrowable::into_previous` turns the caught error into that argument, and the 13 sites now pass it. `getCode()` came along for the ride at the four sites that derive the new exception's code from the caught one (PharArchiver, ArrayLoader x2), and ComposerRepository's message now names the caught exception's class instead of the literal "Exception". GitHubDriver::attemptCloneFallback took the previous exception's message and appended it to its own, which no `\RuntimeException('Fallback to git driver disabled')` in Composer ever says; it now chains it instead. Git::syncMirror restores what PHP's `finally` does to an exception in flight: the `git remote set-url` that scrubs credentials back out of the URL runs in a `finally`, and when it fails PHP propagates *its* exception over the one already leaving, chaining the displaced one as previous. The port discarded the finally's result, so a failure to scrub the URL was reported as a successful mirror sync. `AnyThrowable::set_previous` models the engine-level chaining. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/command/status_command.rs')
0 files changed, 0 insertions, 0 deletions