diff --git a/CHANGELOG.md b/CHANGELOG.md index fafa201..ae3a68b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## Next Release + +- Fixes response hooks raising `NameError` when an HTTP body is not JSON + ## v7.8.0 (2026-10-27) - Removes the deprecated, unusable `add_credit_card` function diff --git a/lib/easypost/http_client.rb b/lib/easypost/http_client.rb index 5d0c9c6..7160fab 100644 --- a/lib/easypost/http_client.rb +++ b/lib/easypost/http_client.rb @@ -76,7 +76,7 @@ def request( if response.is_a?(Net::HTTPResponse) response_body = begin JSON.parse(response.body) - rescue JSON::ParseError + rescue JSON::ParserError response.body end response_context.merge!(