From 35a692eb9710d896e3d5ca6da12eac2856959174 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:34:24 +0000 Subject: [PATCH 1/3] Add RestClient::Gone exception handling to return nil - Adds RestClient::Gone to existing rescue clause alongside NotFound and UnprocessableEntity - Follows same pattern of returning nil for these HTTP error conditions - Fixes rollbar error for Gone (410) responses from FullContact API Co-Authored-By: Grant --- lib/fc_enrich/http_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fc_enrich/http_client.rb b/lib/fc_enrich/http_client.rb index fddbdcf..2975426 100644 --- a/lib/fc_enrich/http_client.rb +++ b/lib/fc_enrich/http_client.rb @@ -8,7 +8,7 @@ def post(path, payload_hash) MultiJson.encode(payload_hash), authorization: "Bearer #{FcEnrich.api_key}") MultiJson.decode(response.body) - rescue RestClient::NotFound, RestClient::UnprocessableEntity + rescue RestClient::NotFound, RestClient::UnprocessableEntity, RestClient::Gone nil rescue RestClient::BadRequest => e raise FcEnrich::BadRequest.new(e.response) From b15cc8b87bb2dfc920844f837913e061980739eb Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:40:52 +0000 Subject: [PATCH 2/3] Add test for RestClient::Gone exception handling - Adds test case for HTTP 410 Gone responses returning nil - Follows existing test pattern using WebMock to stub exception - Verifies RestClient::Gone is handled consistently with other exceptions Co-Authored-By: Grant --- spec/fc_enrich/http_client_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/fc_enrich/http_client_spec.rb b/spec/fc_enrich/http_client_spec.rb index 0abf94e..49a8def 100644 --- a/spec/fc_enrich/http_client_spec.rb +++ b/spec/fc_enrich/http_client_spec.rb @@ -57,5 +57,17 @@ module FcEnrich data = subject.post("/v3/person.enrich", { my_data: "true" }) expect(data).to be_nil end + + it 'handles 410' do + stub_request(:post, "https://api.fullcontact.com/v3/person.enrich") + .with( + body: "{\"my_data\":\"true\"}", + headers: { 'Authorization' => 'Bearer TEST!' } + ) + .and_raise(RestClient::Gone) + + data = subject.post("/v3/person.enrich", { my_data: "true" }) + expect(data).to be_nil + end end end From d100d2b72caa5818fa1117ad85da15f526303679 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 26 Sep 2025 18:45:08 +0000 Subject: [PATCH 3/3] Bump version to 0.4.0 and update CHANGELOG - Update version from 0.3.2 to 0.4.0 in lib/fc_enrich/version.rb - Add CHANGELOG entry for 0.4.0 documenting RestClient::Gone exception handling - Add test coverage entry in changelog Co-Authored-By: Grant --- CHANGELOG.md | 6 +++++- lib/fc_enrich/version.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f9fecb..e8e5c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ +## [0.4.0] +* Add RestClient::Gone exception handling to return nil for HTTP 410 responses +* Add test coverage for RestClient::Gone exception handling + ## [0.3.1] -* Additional fake options to make integration testing easier +* Additional fake options to make integration testing easier ## [0.3.0] * CompanyEnrichRequest diff --git a/lib/fc_enrich/version.rb b/lib/fc_enrich/version.rb index 9217462..0a1356b 100644 --- a/lib/fc_enrich/version.rb +++ b/lib/fc_enrich/version.rb @@ -1,3 +1,3 @@ module FcEnrich - VERSION = "0.3.2" + VERSION = "0.4.0" end