./lib/ews/transporter.rb in exact4r-0.9.1 vs ./lib/ews/transporter.rb in exact4r-0.9.2
- old
+ new
@@ -38,22 +38,22 @@
# Submit a transaction request to the server
#
# <tt>transaction</tt>:: the Request object to encode for transmission to the server
# <tt>transport_type</tt>:: (optional) the transport type to use for this transaction only. If it is not specified, the Transporter's transport type will be used
def submit(transaction, transport_type = nil)
- raise "Request not supplied" if transaction.nil?
+ raise ArgumentError, "Request not supplied" if transaction.nil?
return false unless transaction.valid?
transport_type ||= @transport_type
- raise "Transport type #{transport_type} is not supported" unless @@transport_types.include? transport_type
+ raise ArgumentError, "Transport type #{transport_type} is not supported" unless @@transport_types.include? transport_type
transport_details = @@transport_types[transport_type]
request = build_http_request(transaction, transport_type, transport_details[:suffix])
request.basic_auth(transaction.gateway_id, transaction.password)
request.add_field "Accept", transport_details[:content_type]
- request.add_field "User-Agent", "exact4r v0.9"
+ request.add_field "User-Agent", "exact4r v0.9.1"
request.add_field "Content-type", "#{transport_details[:content_type]}; charset=UTF-8"
response = get_connection.request(request)
case response