Skip to content

Commit 78e4667

Browse files
committed
Unwrap wrapped errors
1 parent a4eba65 commit 78e4667

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/passwordstate/errors.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ def initialize(code, request, response, errors = [])
1212
@code = code.to_i
1313
@request = request
1414
@response = response
15+
16+
if errors.count == 1 && errors.first.is_a?(Hash) && errors.first.key?('errors')
17+
errors = errors.first['errors']
18+
end
1519
@errors = errors
1620

1721
errorstr = errors.map { |err| err['message'] || err['phrase'] || err['error'] }.join('; ')

0 commit comments

Comments
 (0)