Skip to content

Commit

Permalink
chore: log all hq request errors (#3312)
Browse files Browse the repository at this point in the history
* chore: log all hq request errors

* .

* Update lib/avo/licensing/h_q.rb

Co-authored-by: Adrian Marin <[email protected]>

---------

Co-authored-by: Adrian Marin <[email protected]>
  • Loading branch information
Paul-Bob and adrianthedev authored Oct 8, 2024
1 parent fbecba9 commit 7557440
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/avo/licensing/h_q.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ def make_request
cache_and_return_error "Request timeout.", exception.message
rescue SocketError => exception
cache_and_return_error "Connection error.", exception.message
rescue => exception
cache_and_return_error "HQ call error.", exception.message
end
end

Expand All @@ -111,6 +113,8 @@ def perform_and_cache_request
cache_and_return_error "Avo HQ Internal server error.", hq_response.body if hq_response.code == 500
when 200
cache_response response: JSON.parse(hq_response.body)
else
cache_and_return_error "Invalid response.", "code: #{hq_response.code}, body: #{hq_response.body}"
end
end

Expand Down

0 comments on commit 7557440

Please sign in to comment.