From 7e31bab9ff7209c9b6d7928a581d7a449846f42e Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 2 Aug 2026 17:32:43 +0900 Subject: fix(json): propagate JsonFile::encode errors instead of unwrapping PHP's JsonFile::encode throws a RuntimeException when json_encode fails; the port swallowed that into an .unwrap() marked TODO(phase-c). Return anyhow::Result from encode/encode_with_options and propagate at every call site (print_table and list_repositories become Result-returning to carry it). Co-Authored-By: Claude Fable 5 --- crates/shirabe/tests/json/json_manipulator_test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/shirabe/tests/json/json_manipulator_test.rs') diff --git a/crates/shirabe/tests/json/json_manipulator_test.rs b/crates/shirabe/tests/json/json_manipulator_test.rs index 00fa7c24..8e418e2d 100644 --- a/crates/shirabe/tests/json/json_manipulator_test.rs +++ b/crates/shirabe/tests/json/json_manipulator_test.rs @@ -4128,7 +4128,7 @@ fn test_remove_main_key_removes_key_where_value_is_null() { manipulator.remove_main_key("bar").unwrap(); - let expected = JsonFile::encode(&arr(&[("foo", PhpMixed::Int(9000))])); + let expected = JsonFile::encode(&arr(&[("foo", PhpMixed::Int(9000))])).unwrap(); assert_eq!( JsonFile::parse_json(Some(&expected), None).unwrap(), -- cgit v1.3.1