Sha256: 10a4ec38167e5ce9fc958229a52b426c818715c7fa6c01879be1e50b723bcc2e

Contents?: true

Size: 678 Bytes

Versions: 1

Compression:

Stored size: 678 Bytes

Contents

module Arx

  # Various arXiv-related errors.
  module Error

    # Custom error for missing links on an arXiv paper.
    class MissingLink < StandardError
      def initialize(link_type)
        super "This arXiv paper does not have a #{link_type} link"
      end
    end

    # Custom error for missing fields on an arXiv paper.
    class MissingField < StandardError
      def initialize(field)
        super "This arXiv paper is missing the `#{field}` field"
      end
    end

    # Custom error for missing arXiv papers.
    class MissingPaper < StandardError
      def initialize(id)
        super "Couldn't find an arXiv paper with ID: #{id}"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
arx-0.3.1 lib/arx/error.rb