Beispiel
Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies
sha256:3689a956358214e59bb0f50e25447a90b64486b545cea81b569a8c7373cc8f45
PUBLISHED
L3_CONTRACT_PASS
MIT-0
Fall
- Ziel
- Handle query string parameter type collisions and exception types in Faraday::NestedParamsEncoder and Faraday error hierarchies HOW
- Pakete
- faraday 2.14.3
- Umgebung
- ruby
- Erstellt
- 2026-08-16T17:18:49Z
Häufige Annahme
Faraday::NestedParamsEncoder.decode raises Faraday::ParsingError when query parameters conflict, and client timeouts inherit from Faraday::ClientError rather than Faraday::ServerError.
So hat der Autor des Samples festgehalten, was eine Entwicklerin oder ein Modell hier erwarten würde. Der Vertrag darunter ist das, was tatsächlich lief.
Contract
- Faraday::NestedParamsEncoder.decode raises Ruby core TypeError instead of Faraday::ParsingError when a scalar parameter precedes a nested key, but silently overwrites and returns the scalar when the nested key comes first.
- TypeError raised on parameter collisions does not inherit from Faraday::Error, escaping rescue Faraday::Error handlers.
- Faraday::NestedParamsEncoder.decode converts nested hashes whose subkeys are all numeric digits into an Array sorted lexicographically by string comparison.
- Faraday::NestedParamsEncoder.encode raises Ruby core TypeError rather than Faraday::Error or ArgumentError when input cannot be converted to a Hash.
- Faraday::FlatParamsEncoder.decode preserves colliding keys without raising exceptions or converting nested structures.
- Faraday::TimeoutError inherits from Faraday::ServerError rather than Faraday::ClientError, meaning rescue Faraday::ServerError intercepts client timeouts while rescue Faraday::ClientError only catches HTTP 408 Faraday::RequestTimeoutError.
- Faraday::RequestTimeoutError inherits from Faraday::ClientError for HTTP 408 responses.
- Faraday::NilStatusError inherits from Faraday::ServerError when status cannot be derived.
- Faraday::ConnectionFailed inherits directly from Faraday::Error rather than ClientError or ServerError.
- Faraday::Error#response returns a Hash rather than a Faraday::Response instance, causing direct method calls like response.status to raise NoMethodError.
Dateien
- Gemfile
- Gemfile.lock
- NOTES.md
- csx.json
- test/contract.rb
Verifiziertes Artefakt herunterladen (tar.gz) — genau die Bytes, gegen die der Contract lief
Ursprungs-Seeder
Verifizierungsbelege
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9