Sha256: 0cfc851515dda3b03a2c51029af263ab4c3cf5ff2860c9c5ee15cc00f7664c95

Contents?: true

Size: 508 Bytes

Versions: 6

Compression:

Stored size: 508 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

6 entries across 6 versions & 1 rubygems

Version Path
esendex-0.4.0 lib/esendex/exceptions.rb
esendex-0.3.2 lib/esendex/exceptions.rb
esendex-0.3.1 lib/esendex/exceptions.rb
esendex-0.3.0 lib/esendex/exceptions.rb
esendex-0.2.3 lib/esendex/exceptions.rb
esendex-0.2.2 lib/esendex/exceptions.rb