diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-03 22:24:51 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-03 22:24:51 +0900 |
| commit | eba99f7e5f38d9501b37d9b188b6f324a947dc74 (patch) | |
| tree | 27c893a33e6176acfe569d6175b13364783a7b95 /crates/shirabe/src/package | |
| parent | 27764ef4447a02e5c59bbcc7b4547838aae82d89 (diff) | |
| download | php-shirabe-eba99f7e5f38d9501b37d9b188b6f324a947dc74.tar.gz php-shirabe-eba99f7e5f38d9501b37d9b188b6f324a947dc74.tar.zst php-shirabe-eba99f7e5f38d9501b37d9b188b6f324a947dc74.zip | |
fix(config,loader): wire JsonValidationException catch; drop unportable chain TODOs
JsonConfigSource::manipulate_json now downcasts the validate_schema error
to JsonValidationException (matching PHP's specific catch), restores the
original contents, and surfaces e.get_errors(); other errors propagate.
ArrayLoader's two version-parse catch sites only had TODOs for preserving
the original exception as 'previous'. shirabe_semver raises generic
anyhow errors (not shim exception types), so the existing catch-all is
already faithful to PHP's catch (\UnexpectedValueException), and the flat
shim exception structs intentionally hold no previous field; the wrapped
message already carries the original cause. Remove the stale TODOs.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe/src/package')
| -rw-r--r-- | crates/shirabe/src/package/loader/array_loader.rs | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crates/shirabe/src/package/loader/array_loader.rs b/crates/shirabe/src/package/loader/array_loader.rs index e1cc60b..634bef8 100644 --- a/crates/shirabe/src/package/loader/array_loader.rs +++ b/crates/shirabe/src/package/loader/array_loader.rs @@ -195,7 +195,6 @@ impl ArrayLoader { { Ok(v) => version = v, Err(e) => { - // TODO(phase-b): preserve original exception chain via anyhow::Error::context return Err(UnexpectedValueException { message: format!( "Failed to normalize version for package \"{}\": {}", @@ -761,9 +760,7 @@ impl ArrayLoader { let parsed_constraint = match self.version_parser.parse_constraints(&constraint) { Ok(c) => c, - Err(e) => { - // TODO(phase-b): preserve original exception chain - let _ = &e; + Err(_e) => { return Err(UnexpectedValueException { message: format!( "Link constraint in {} {} > {} should be a valid version constraint, got \"{}\"", |
