Skip to content

Commit fb22ef0

Browse files
author
alex.khalevine
committed
fix for unhandled body parse error
1 parent 54e75c9 commit fb22ef0

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
/.bundle/
23
/.yardoc
34
/Gemfile.lock

lib/eversign/client.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,12 @@ def send_reminder_for_document(document_hash, signer_id)
155155
private
156156

157157
def append_sdk_id (body)
158-
unless body.nil?
158+
begin
159159
bodyHash = JSON.parse(body)
160160
bodyHash['client'] = 'ruby-sdk'
161161
return bodyHash.to_json
162+
rescue
163+
return body
162164
end
163165
end
164166

@@ -173,6 +175,7 @@ def execute_request(method, path, body = nil, multipart = false)
173175

174176
body = append_sdk_id(body)
175177

178+
176179
@faraday.send(method) do |request|
177180
request.url path
178181
request.body = body if body

0 commit comments

Comments
 (0)