From c5845dee07d0c8c1df9ea095d8c5b71ea6b50e0b Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Sun, 26 May 2024 20:29:24 +0200 Subject: [PATCH] Raise when balance call can't reach Tab --- app/models/user.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 4b60d982..c79f9a21 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -83,7 +83,8 @@ def balance result = HTTParty.get(File.join(Rails.application.config.api_url, "users", "#{name}.json"), headers: headers) JSON.parse(result.body)["balance"] if result.code == 200 - rescue StandardError # rubocop:disable Lint/SuppressedException + rescue StandardError => e + raise "Error fetching balance from Tab: #{e}" end end