Sha256: 53f280b5e18621504f5d9ace1a97dc3f53e87cbda724c28edd1e54f721f24332

Contents?: true

Size: 1.19 KB

Versions: 26

Compression:

Stored size: 1.19 KB

Contents

module OEmbed
  
  # A generic OEmbed-related Error. The OEmbed library does its best to capture all internal
  # errors and wrap them in an OEmbed::Error class so that the error-handling code in your
  # application can more easily identify the source of errors.
  #
  # The following Classes inherit from OEmbed::Error
  # * OEmbed::FormatNotSupported
  # * OEmbed::NotFound
  # * OEmbed::ParseError
  # * OEmbed::UnknownFormat
  # * OEmbed::UnknownResponse
  class Error < StandardError
  end

  # This is a test
  class NotFound < OEmbed::Error # :nodoc:
    def to_s
      "No embeddable content at '#{super}'"
    end
  end

  class UnknownFormat < OEmbed::Error # :nodoc:
    def to_s
      "The provider doesn't support the '#{super}' format"
    end
  end

  class FormatNotSupported < OEmbed::Error # :nodoc:
    def to_s
      "This server doesn't have the correct libraries installed to support the '#{super}' format"
    end
  end

  class UnknownResponse < OEmbed::Error # :nodoc:
    def to_s
      "Got unknown response (#{super}) from server"
    end
  end

  class ParseError < OEmbed::Error # :nodoc:
    def to_s
      "There was an error parsing the server response (#{super})"
    end
  end
    
end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
ruby-oembed-0.8.9 lib/oembed/errors.rb
ruby-oembed-0.8.8 lib/oembed/errors.rb
ruby-oembed-0.8.7 lib/oembed/errors.rb
ruby-oembed-0.8.5 lib/oembed/errors.rb
ruby-oembed-0.8.3 lib/oembed/errors.rb
ruby-oembed-0.8.1 lib/oembed/errors.rb