Permalink
Browse files

return nil if no order is found

  • Loading branch information...
1 parent b7e62b0 commit 19549cc92a6d2ada2ee63db8f5f56ffb111fcb14 @jzw jzw committed Sep 19, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/powa_api/order_service.rb
@@ -29,6 +29,7 @@ def self.get_order_details(order_number)
client = Savon.client wsdl
+ begin
response = client.request :get_order_details do
soap.xml do |xml|
xml.soapenv(:Envelope, namespaces) do |xml|
@@ -43,6 +44,10 @@ def self.get_order_details(order_number)
end
end
end
+ rescue Savon::SOAP::Fault => e
+ return nil if e.message.include?("Order not found")
+ raise e.message
+ end
response.to_array(:get_order_details_response).first

0 comments on commit 19549cc

Please sign in to comment.