Skip to content

Commit 4b70c5a

Browse files
authored
Fix exception handling (#21)
1 parent 3c356da commit 4b70c5a

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### v0.8.1.pre
2+
3+
* bug-fixes
4+
* Fix exception handling
5+
16
### v0.8.0.pre
27

38
* deprecations

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
beyond_api (0.8.0.pre)
4+
beyond_api (0.8.1.pre)
55
faraday (~> 0.15)
66

77
GEM

lib/beyond_api/utils.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ def handle_response(response, status, respond_with_true: false)
1010
response = sanitize_response(response)
1111
BeyondApi.configuration.object_struct_responses ? to_object_struct(response) : response
1212
else
13-
error = BeyondApi::Error.new(response)
1413
BeyondApi.logger.error "[Beyond API] #{response}"
15-
BeyondApi.configuration.raise_error_requests ? raise(error) : error
14+
BeyondApi.configuration.raise_error_requests ? raise(response.to_s) : BeyondApi::Error.new(response)
1615
end
1716
end
1817

lib/beyond_api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module BeyondApi
2-
VERSION = "0.8.0.pre".freeze
2+
VERSION = "0.8.1.pre".freeze
33
end

0 commit comments

Comments
 (0)