17#ifndef HOOVER_CHESS_UTILS__PGN_READER__PGNREADER_ERROR_H_INCLUDED
18#define HOOVER_CHESS_UTILS__PGN_READER__PGNREADER_ERROR_H_INCLUDED
94 const char *
what() const noexcept
override
PGN error exception.
Definition pgnreader-error.h:70
const char * what() const noexcept override
Returns the error message.
Definition pgnreader-error.h:94
PgnErrorCode m_code
Error code.
Definition pgnreader-error.h:76
PgnError(PgnErrorCode code, std::string_view details)
Constructor: error code and error message.
static std::string_view getStringForCode(PgnErrorCode code) noexcept
Returns error string for code.
PgnError(const PgnScanner &scanner, const PgnError &ex)
Constructor: adds position to a PGN error.
std::string m_str
Error string.
Definition pgnreader-error.h:73
PgnErrorCode getCode() const noexcept
Returns the error code.
Definition pgnreader-error.h:102
The PGN scanner (lexer)
Definition pgnscanner.h:40
PgnErrorCode
Error code.
Definition pgnreader-error.h:35
@ BAD_CHARACTER
Unexpected character in PGN input (tokenizer error)
@ BAD_PGN_TAG
PGN tag parsing failed (parser error)
@ ILLEGAL_MOVE
Illegal move.
@ UNEXPECTED_MOVE_NUM
Unexpected (bad) move number (PGN reader error)
@ AMBIGUOUS_MOVE
Ambiguous move (missing source file/rank specifiers)
@ UNEXPECTED_TOKEN
Unexpected (bad) token (parser error)
@ UNIMPLEMENTED
Unimplemented functionality.
@ BAD_FEN
Bad or illegal FEN (position setup error)
@ OK
Code for success. Never set in PgnError by this code base.
@ INTERNAL_ERROR
Internal logic error.
Definition chessboard-types-squareset.h:30