Skip to content

Commit

Permalink
Raise when balance call can't reach Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
TomNaessens committed May 26, 2024
1 parent 828973d commit c5845de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c5845de

Please sign in to comment.