21#ifndef KI_EXCEPTION_H_
22#define KI_EXCEPTION_H_
36#define THROW_IO_ERROR( msg ) throw IO_ERROR( msg, __FILE__, __FUNCTION__, __LINE__ )
37#define THROW_IO_ERRORF( msg, ... ) throw IO_ERROR( wxString::Format( msg, __VA_ARGS__ ), \
38 __FILE__, __FUNCTION__, __LINE__ )
57 const wxString
What()
const
87 IO_ERROR(
const wxString& aProblem,
const char* aThrowersFile,
88 const char* aThrowersFunction,
int aThrowersLineNumber )
90 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber );
96 void init(
const wxString& aProblem,
const char* aThrowersFile,
97 const char* aThrowersFunction,
int aThrowersLineNumber );
99 virtual const wxString Problem()
const;
100 virtual const wxString Where()
const;
102 virtual const char* what()
const throw() override;
103 virtual const wxString What() const;
124 IO_CANCELLED(
const char* aThrowersFile,
const char* aThrowersFunction,
int aThrowersLineNumber,
125 const wxString& aProblem = wxEmptyString );
129#define THROW_IO_CANCELLED() throw IO_CANCELLED( __FILE__, __FUNCTION__, __LINE__ )
131#define THROW_IO_CANCELLED_MSG( msg ) throw IO_CANCELLED( __FILE__, __FUNCTION__, __LINE__, msg )
157 const char* aThrowersFunction,
int aThrowersLineNumber,
158 const wxString& aSource,
const char* aInputLine,
159 int aLineNumber,
int aByteIndex ) :
162 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber,
163 aSource, aInputLine, aLineNumber, aByteIndex );
166 void init(
const wxString& aProblem,
const char* aThrowersFile,
167 const char* aThrowersFunction,
int aThrowersLineNumber,
168 const wxString& aSource,
const char* aInputLine,
169 int aLineNumber,
int aByteIndex );
187#define THROW_PARSE_ERROR( aProblem, aSource, aInputLine, aLineNumber, aByteIndex ) \
188 throw PARSE_ERROR( aProblem, __FILE__, __FUNCTION__, __LINE__, aSource, aInputLine, \
189 aLineNumber, aByteIndex )
203 const wxString& aRequiredGenerator = wxEmptyString );
205 const wxString& aRequiredGenerator = wxEmptyString );
208 void init(
const wxString& aRequiredVersion,
209 const wxString& aRequiredGenerator = wxEmptyString );
IO_CANCELLED(const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aProblem=wxEmptyString)
Normally thrown via the macro THROW_IO_CANCELLED(), which supplies the call-site file,...
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
IO_ERROR(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
Use macro THROW_IO_ERROR() to wrap a call to this constructor at the call site.
KI_PARAM_ERROR(const wxString &aMessage)
Constructor.
const wxString What() const
virtual ~KI_PARAM_ERROR()
int lineNumber
at which line number, 1 based index.
const wxString ParseProblem()
std::string inputLine
problem line of input [say, from a LINE_READER].
PARSE_ERROR(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aSource, const char *aInputLine, int aLineNumber, int aByteIndex)
Normally called via the macro THROW_PARSE_ERROR so that FILE, FUNCTION, and LINE can be captured from...
int byteIndex
at which byte offset within the line, 1 based index
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber, const wxString &aSource, const char *aInputLine, int aLineNumber, int aByteIndex)