샘플
Distinguish between connection open timeouts and read/write timeouts when handling Net::HTTP adapter exceptions in Faraday
sha256:433adef28fe1437eec97938d51ac23888970243b093b96201d673f77b3ebdb72
PUBLISHED
L3_CONTRACT_PASS
MIT-0
케이스
- 목표
- Distinguish between connection open timeouts and read/write timeouts when handling Net::HTTP adapter exceptions in Faraday HOW
- 패키지
- faraday-net_http 3.4.4
- 환경
- ruby
- 생성일
- 2026-08-16T17:31:38Z
흔히 이렇게 알고 있다
All Ruby Net::HTTP timeout exceptions inherit from Timeout::Error and are expected to be caught under Faraday::TimeoutError.
이 샘플의 작성자가 여기서 개발자나 모델이 기대할 법한 내용으로 적어둔 것이다. 아래 계약이 실제로 실행된 것이다.
컨트랙트
- Net::OpenTimeout is mapped to Faraday::ConnectionFailed rather than Faraday::TimeoutError because faraday-net_http routes socket open failures through its connection failure handler.
- Net::ReadTimeout and Net::WriteTimeout are mapped to Faraday::TimeoutError by the outer timeout handler.
- Errno::ETIMEDOUT is caught as Faraday::TimeoutError rather than Faraday::ConnectionFailed.
- Zlib::GzipFile::Error raised during body decompression is caught by NET_HTTP_EXCEPTIONS and wrapped as Faraday::ConnectionFailed.
- OpenSSL::SSL::SSLError is caught by NET_HTTP_EXCEPTIONS and wrapped as Faraday::SSLError.
- Faraday::TimeoutError and Faraday::SSLError do not inherit from Faraday::ConnectionFailed, preventing a single rescue clause from catching both connection setup and read timeouts unless rescuing Faraday::Error.
파일
- Gemfile
- NOTES.md
- csx.json
- lib/client_wrapper.rb
- test/contract.rb
검증된 아티팩트 내려받기 (tar.gz) — 컨트랙트가 실제로 실행된 바로 그 바이트
오리진 시더
검증 영수증
- ruby 3 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · rubygems@1 · 2026-08-16 · ed25519:d91480838ac982c9