Skip to content

Commit

Permalink
fix for unhandled body parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
alex.khalevine committed May 5, 2021
1 parent 54e75c9 commit fb22ef0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
/.bundle/
/.yardoc
/Gemfile.lock
Expand Down
5 changes: 4 additions & 1 deletion lib/eversign/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ def send_reminder_for_document(document_hash, signer_id)
private

def append_sdk_id (body)
unless body.nil?
begin
bodyHash = JSON.parse(body)
bodyHash['client'] = 'ruby-sdk'
return bodyHash.to_json
rescue
return body
end
end

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

body = append_sdk_id(body)


@faraday.send(method) do |request|
request.url path
request.body = body if body
Expand Down

0 comments on commit fb22ef0

Please sign in to comment.