Sha256: eb15bd68dc04a9979ca8bb7e93602bfb5d9d422b1bd323288a41ac0d28be94aa

Contents?: true

Size: 458 Bytes

Versions: 4

Compression:

Stored size: 458 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
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
esendex-0.2.1 lib/esendex/exceptions.rb
esendex-0.2.0 lib/esendex/exceptions.rb
esendex-0.1.1 lib/esendex/exceptions.rb
esendex-0.1.0 lib/esendex/exceptions.rb