Sha256: 2ec9965ef146e3fca8ce09bb9302d0e9dd6f3f42004ffd0519501067ae48fec9

Contents?: true

Size: 777 Bytes

Versions: 8

Compression:

Stored size: 777 Bytes

Contents

module Chess
  # This exception will be raised when an invalid short algebraic chess notation
  # string is passed to the {Game#move} function.
  class BadNotationError < StandardError
    # @param [String] notation The invalid notation.
    def initialize(notation)
      super("Invalid notation '#{notation}'")
    end
  end

  # This exception will be raised when a malformed PGN file is loaded.
  class InvalidPgnFormatError < StandardError
    def initialize
      super('Invalid PGN format')
    end
  end

  # This exception will be raised when an invalid FEN string is used.
  class InvalidFenFormatError < StandardError
    # @param [String] fen_string The FEN string.
    def initialize(fen_string)
      super("Invalid FEN string '#{fen_string}'")
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
chess-0.4.0 lib/chess/exceptions.rb
chess-0.3.6 lib/chess/exceptions.rb
chess-0.3.5 lib/chess/exceptions.rb
chess-0.3.4 lib/chess/exceptions.rb
chess-0.3.3 lib/chess/exceptions.rb
chess-0.3.2 lib/chess/exceptions.rb
chess-0.3.1 lib/chess/exceptions.rb
chess-0.3.0 lib/chess/exceptions.rb