Skip to content

Commit

Permalink
fix(forest-requester): forest reporter now gets actual error instead …
Browse files Browse the repository at this point in the history
…of message (#711)
  • Loading branch information
SteveBunlon authored Dec 27, 2024
1 parent d1424f4 commit 0b8611f
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions app/services/forest_liana/forest_api_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ def self.get(route, query: nil, headers: {})
headers: base_headers.merge(headers),
query: query,
}).response
rescue
message = "Cannot reach Forest API at #{forest_api_url}#{route}, it seems to be down right now."
FOREST_LOGGER.error message
FOREST_REPORTER.report message
raise
rescue => error
FOREST_LOGGER.error "Cannot reach Forest API at #{forest_api_url}#{route}, it seems to be down right now."
FOREST_REPORTER.report error
raise error
end
end

Expand All @@ -31,11 +30,10 @@ def self.post(route, body: nil, query: nil, headers: {})
query: query,
body: body.to_json,
}).response
rescue
message = "Cannot reach Forest API at #{post_route}, it seems to be down right now."
FOREST_LOGGER.error message
FOREST_REPORTER.report message
raise
rescue => error
FOREST_LOGGER.error "Cannot reach Forest API at #{post_route}, it seems to be down right now."
FOREST_REPORTER.report error
raise error
end
end

Expand Down

0 comments on commit 0b8611f

Please sign in to comment.