From 20f9787cda5b846c730cff97a4c7a3777ff3414a Mon Sep 17 00:00:00 2001 From: nsfisis Date: Mon, 24 Aug 2026 21:07:26 +0900 Subject: refactor(silencer): stop guarding work that stays inside Rust Silencer only lowers the PHP error_reporting() level and re-throws whatever the guarded work raises. A region that never reaches the PHP runtime has no level to lower and emits no diagnostic on failure, so wrapping it is indistinguishable from running it unguarded. The pair kept in Application::hint_common_errors brackets a getComposer() call, which loads installed plugins and dispatches PluginEvents::INIT. Co-Authored-By: Claude Opus 5 --- crates/shirabe/src/util/silencer.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crates/shirabe/src/util/silencer.rs') diff --git a/crates/shirabe/src/util/silencer.rs b/crates/shirabe/src/util/silencer.rs index 7286689a..e2b2ac9e 100644 --- a/crates/shirabe/src/util/silencer.rs +++ b/crates/shirabe/src/util/silencer.rs @@ -35,6 +35,11 @@ impl Silencer { } } + /// Wrap a callable only when it can reach the PHP runtime, where a plugin may emit diagnostics + /// of its own; the same holds for a region bracketed by `suppress` and `restore`. Work that + /// stays inside Rust has no `error_reporting()` level to lower and emits no diagnostic on + /// failure, and errors it raises propagate either way, so silencing it is indistinguishable + /// from running it unguarded. Run it unguarded instead. pub fn call(callable: F) -> anyhow::Result where F: FnOnce() -> anyhow::Result, -- cgit v1.3.1-4-g156e