From 2c3373a7466c31f5cce7c2867c00a91afaa8e128 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 08:55:56 +0900 Subject: fix(io): propagate ask/select errors instead of panicking IOInterface::ask/select now return anyhow::Result, 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 --- crates/shirabe/tests/io/null_io_test.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crates/shirabe/tests/io/null_io_test.rs') diff --git a/crates/shirabe/tests/io/null_io_test.rs b/crates/shirabe/tests/io/null_io_test.rs index 1627e91f..ced598b9 100644 --- a/crates/shirabe/tests/io/null_io_test.rs +++ b/crates/shirabe/tests/io/null_io_test.rs @@ -45,6 +45,7 @@ fn test_ask() { assert_eq!( PhpMixed::String("foo".to_string()), io.ask("bar".to_string(), PhpMixed::String("foo".to_string())) + .unwrap() ); } @@ -88,5 +89,6 @@ fn test_select() { "foo".to_string(), true ) + .unwrap() ); } -- cgit v1.3.1