class ZuoraAPI::Exceptions::Error

def parse_message(message)

def parse_message(message)
  case message
  when /^Payment status should be Processed. Invalid payment is P-\d*./
    @message = "Payment status should be Processed."  
  when /^Adjustment cannot be created for invoice(.*) with a zero balance./
    @message = "Adjustment cannot be created for invoice with a zero balance."
  when /^The balance of all the invoice items and tax items is 0. No write-off is needed for the invoice .*./
    @message = "The balance of all the invoice items and tax items is 0. No write-off is needed for the invoice."
  when /^Json input does not match schema. Error(s): string ".*" is too long .*/
    @message = "Json input does not match schema. Error(s): String is too long."
  when /^Query failed \(#[\d\w_]*\): line [0-9]+:[0-9]+: (.*)$/
    @message = "Query failed: #{$1}"
  when /^Query failed \(#[\d\w_]*\): (.*)$/
    @message = "Query failed: #{$1}"
  when /^Could not find [\w\d]{32}.$/
    @message = "Could not find object."
  when /^Subscription [\w\d]{32} is in expired status. It is not supported to generate billing documents for expired subscriptions./
    @message = "Subscription is in expired status. It is not supported to generate billing documents for expired subscriptions."
  else
    @message = message
  end
end