From d7896d0731b17ed2db4ec5f3db42e750440d98eb Mon Sep 17 00:00:00 2001 From: ronniebermejo Date: Tue, 17 Jun 2014 19:25:14 -0500 Subject: [PATCH] Standard exceptions replaced non standard exceptions. [skip ci] --- README.md | 4 ++-- lib/openpay/customers.rb | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 35a6d9f..9ed490b 100644 --- a/README.md +++ b/README.md @@ -654,9 +654,9 @@ open_pay_resource.delete_all(customer_id=nil) This API generates 3 different Exception classes. -- **OpenpayException**: Generic base api exception class, for generic api exceptions. +- **OpenpayException**: Generic base API exception class, Generic API exceptions. - - Internal server error (500 Internal Server Error) + - Internal server error (500 Internal Server Error). - OpenpayApi factory method, invalid resource name. Examples: diff --git a/lib/openpay/customers.rb b/lib/openpay/customers.rb index 65bef9f..dc2dd67 100644 --- a/lib/openpay/customers.rb +++ b/lib/openpay/customers.rb @@ -154,7 +154,7 @@ def update_subscription(subscription, customer, params) def delete_all_subscriptions(customer_id) if env == :production - raise OpenPayError ('This method is not supported on PRODUCTION') + raise OpenpayException.new('This method is not supported on PRODUCTION', false) end all_subscriptions(customer_id).each do |sub| delete_subscription(customer_id, sub['id']) @@ -176,7 +176,7 @@ def delete_card(customer, card_id) def delete_all_cards(customer_id) if env == :production - raise OpenPayError ('This method is not supported on PRODUCTION') + raise OpenpayException.new('This method is not supported on PRODUCTION', false) end each_card(customer_id) do |card| delete_card(customer_id, card['id'])