From 1248df1f40235248d3e36dcea8972d2463492cc3 Mon Sep 17 00:00:00 2001 From: "gocardless-ci-robot[bot]" <123969075+gocardless-ci-robot[bot]@users.noreply.github.com> Date: Tue, 13 Oct 2026 14:42:12 +0000 Subject: [PATCH] Changes generated by 60d9dc67c16fad554baaed460a9778c54f598468 This commit was automatically created from gocardless/client-library-templates@60d9dc67c16fad554baaed460a9778c54f598468 by the `push-files` action. Workflow run: https://github.com/gocardless/client-library-templates/actions/runs/38415203849 --- CHANGELOG.md | 12 ++++++++++++ lib/gocardless_pro/client.rb | 2 +- lib/gocardless_pro/version.rb | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6639b5..53d1152 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog +## 4.20.1 (2026-10-13) + +### Fixes + +#### Fix crash on string error bodies and unrecognised error types + +Error responses whose `error` is a plain string, with a status other than 400, 401, 403 or 429 (for example a 404 or 422), previously raised `NoMethodError: undefined method 'to_sym' for nil` instead of a GoCardless error. They now raise `GoCardlessPro::ApiError` with the message from the response. + +Error responses with an unrecognised `type` now also raise `GoCardlessPro::ApiError` instead of `KeyError`. + +`code` is now set to the HTTP status for string error bodies. It was previously `nil`. + ## 4.20.0 (2026-10-12) ### Features diff --git a/lib/gocardless_pro/client.rb b/lib/gocardless_pro/client.rb index cb9b7cf..79e97ac 100644 --- a/lib/gocardless_pro/client.rb +++ b/lib/gocardless_pro/client.rb @@ -283,7 +283,7 @@ def default_options 'User-Agent' => "#{user_agent}", 'Content-Type' => 'application/json', 'GoCardless-Client-Library' => 'gocardless-pro-ruby', - 'GoCardless-Client-Version' => '4.20.0', + 'GoCardless-Client-Version' => '4.20.1', }, } end diff --git a/lib/gocardless_pro/version.rb b/lib/gocardless_pro/version.rb index 4a9c49f..658627a 100644 --- a/lib/gocardless_pro/version.rb +++ b/lib/gocardless_pro/version.rb @@ -3,5 +3,5 @@ module GoCardlessPro module GoCardlessPro # Current version of the GC gem - VERSION = '4.20.0' + VERSION = '4.20.1' end