americommerce-api 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -59,8 +59,13 @@ module AmericommerceApi
59
59
  private
60
60
 
61
61
  def request(call_action, request_params={})
62
- response = @client.call(call_action, message: request_params)
63
- return AmericommerceApi::Response.format(response, call_action)
62
+ begin
63
+ response = @client.call(call_action, message: request_params)
64
+ return AmericommerceApi::Response.format(response, call_action)
65
+ rescue Exception => e
66
+ #check invalid by message of error because code returned by americommerce is 500 and not 4**
67
+ raise e.message.include?('Unauthorized Request') ? AmericommerceApi::Exceptions::InvalidCredentials : e
68
+ end
64
69
  end
65
70
 
66
71
  def init_client(ac_header, wsdl)
@@ -1,3 +1,3 @@
1
1
  module Americommerce
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: americommerce-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: