Sha256: 30130ac164eced5fc0c2236554ea96fd0fa6c93d74c2689d0fab89be212b5c06

Contents?: true

Size: 533 Bytes

Versions: 2

Compression:

Stored size: 533 Bytes

Contents

module Esendex
  class ApiErrorFactory
    def get_api_error(source_error)
      case source_error
      when Nestful::ForbiddenAccess
        return ForbiddenError.new
      when Nestful::UnauthorizedAccess
        return NotAuthorizedError.new
      else
        return ApiError.new(source_error)
      end
    end
  end
  
  class ApiError < StandardError
  end
  
  class NotAuthorizedError < ApiError
  end
  
  class ForbiddenError < ApiError
  end
  
  class AccountReferenceError < ApiError
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
esendex-0.6.0 lib/esendex/exceptions.rb
esendex-0.5.0 lib/esendex/exceptions.rb