Skip to content

Commit 4dc4f0b

Browse files
author
Mooli Tayer
committed
Change error handling
- Catch only standard errors - Include original error message in raise error
1 parent 2497db0 commit 4dc4f0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/prometheus/api_client/client.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def run_command(command, options)
102102
response = get(command, options)
103103

104104
JSON.parse(response.body)['data']
105-
rescue
106-
raise RequestError, 'Bad response from server'
105+
rescue StandardError => err
106+
raise RequestError, err.message
107107
end
108108

109109
# Helper function to evalueate the low level proxy option

0 commit comments

Comments
 (0)