Sha256: a0de852731c5ef81404c957d9fb16d64fb82a9af3516cbd3576f38e5bd24709c

Contents?: true

Size: 835 Bytes

Versions: 6

Compression:

Stored size: 835 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
    # :nodoc:
    # Create a new exception.
    def initialize(notation)
      super("The notation '#{notation}' is invalid")
    end
  end

  # This exception will be raised when a malformed PGN file is loaded.
  class InvalidPgnFormatError < StandardError
    # :nodoc:
    # Create a new exception.
    def initialize(filename)
      super("Invalid PGN file: '#{filename}'")
    end
  end

  # This exception will be raised when an invalid FEN string is used.
  class InvalidFenFormatError < StandardError
    # :nodoc:
    # Create a new exception.
    def initialize(fen_string)
      super("Invalid FEN string: '#{fen_string}'")
    end
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
chess-0.0.6 lib/chess/exceptions.rb
chess-0.0.5 lib/chess/exceptions.rb
chess-0.0.4 lib/chess/exceptions.rb
chess-0.0.3 lib/chess/exceptions.rb
chess-0.0.2 lib/chess/exceptions.rb
chess-0.0.1 lib/chess/exceptions.rb