diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-02 08:55:56 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-02 08:55:56 +0900 |
| commit | 2c3373a7466c31f5cce7c2867c00a91afaa8e128 (patch) | |
| tree | 754c7da92def5d14fc425230f9db41c654897b4f /crates/shirabe/src/downloader | |
| parent | 92f5c977b42d1322f3cebb260024179e1285b9d0 (diff) | |
| download | php-shirabe-2c3373a7466c31f5cce7c2867c00a91afaa8e128.tar.gz php-shirabe-2c3373a7466c31f5cce7c2867c00a91afaa8e128.tar.zst php-shirabe-2c3373a7466c31f5cce7c2867c00a91afaa8e128.zip | |
fix(io): propagate ask/select errors instead of panicking
IOInterface::ask/select now return anyhow::Result<PhpMixed>, and
ConsoleIO::ask_question forwards QuestionHelper errors (validator
failures, MissingInputException) instead of collapsing them with
.expect(). In PHP these exceptions propagate from QuestionHelper
through ConsoleIO to the caller, so callers such as UpdateCommand's
interactive package selection must be able to observe them; the
MissingInputException is wrapped with its concrete type preserved so
Application's ExceptionInterface downcast keeps working. All call
sites now propagate with `?` (Perforce::query_p4_user becomes
Result-returning: PHP declares it void but exceptions still escape),
and the previously ignored
test_interactive_mode_throws_if_no_package_entered passes.
ask_confirmation/ask_and_hide_answer still collapse errors; extending
propagation to them is left as TODO(phase-c) pending a decision.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/downloader')
| -rw-r--r-- | crates/shirabe/src/downloader/git_downloader.rs | 2 | ||||
| -rw-r--r-- | crates/shirabe/src/downloader/svn_downloader.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/shirabe/src/downloader/git_downloader.rs b/crates/shirabe/src/downloader/git_downloader.rs index c2599d2b..fe725507 100644 --- a/crates/shirabe/src/downloader/git_downloader.rs +++ b/crates/shirabe/src/downloader/git_downloader.rs @@ -1265,7 +1265,7 @@ impl VcsDownloader for GitDownloader { if update { "s," } else { "" } ), PhpMixed::String("?".to_string()), - ) + )? .as_string() .map(|s| s.to_string()); let mut do_help = false; diff --git a/crates/shirabe/src/downloader/svn_downloader.rs b/crates/shirabe/src/downloader/svn_downloader.rs index e72bd40a..f5b7a833 100644 --- a/crates/shirabe/src/downloader/svn_downloader.rs +++ b/crates/shirabe/src/downloader/svn_downloader.rs @@ -308,7 +308,7 @@ impl VcsDownloader for SvnDownloader { .ask( " <info>Discard changes [y,n,v,?]?</info> ".to_string(), PhpMixed::String("?".to_string()), - ) + )? .as_string() { Some("y") => { |
