Skip to content

Commit c89ed7b

Browse files
authored
Release v0.11.1.pre
* bug-fixes * Use `BeyondApi::Error` for authentication errors
1 parent 1536161 commit c89ed7b

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### v0.11.1.pre
2+
3+
* bug-fixes
4+
* Use `BeyondApi::Error` for authentication errors
5+
16
### v0.11.0.pre
27

38
* enhancements

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.11.0.pre)
4+
beyond_api (0.11.1.pre)
55
faraday (~> 0.15)
66

77
GEM

lib/beyond_api/error.rb

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,18 @@
22

33
module BeyondApi
44
class Error < StandardError
5-
attr_reader :error_id, :details, :trace_id, :full_message, :status_code
5+
attr_reader :error_id, :details, :trace_id, :full_message, :status_code, :error, :error_description
66

77
def initialize(data, status_code = nil)
8-
@error_id = data['errorId']
9-
@details = data['details']
10-
@trace_id = data['traceId']
11-
@full_message = data
12-
@status_code = status_code
8+
@error_id = data['errorId']
9+
@details = data['details']
10+
@trace_id = data['traceId']
11+
@error = data['error']
12+
@error_description = data['error_description']
13+
@full_message = data
14+
@status_code = status_code
1315

14-
super(data['message'])
16+
super(data['message'] || data['error_description'])
1517
end
1618
end
1719
end

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.11.0.pre".freeze
2+
VERSION = "0.11.1.pre".freeze
33
end

0 commit comments

Comments
 (0)