25#ifndef KI_EXCEPTION_H_
26#define KI_EXCEPTION_H_
39#define THROW_IO_ERROR( msg ) throw IO_ERROR( msg, __FILE__, __FUNCTION__, __LINE__ )
58 const wxString
What()
const
88 IO_ERROR(
const wxString& aProblem,
const char* aThrowersFile,
89 const char* aThrowersFunction,
int aThrowersLineNumber )
91 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 wxString What()
const;
135 const char* aThrowersFunction,
int aThrowersLineNumber,
136 const wxString& aSource,
const char* aInputLine,
137 int aLineNumber,
int aByteIndex ) :
140 init( aProblem, aThrowersFile, aThrowersFunction, aThrowersLineNumber,
141 aSource, aInputLine, aLineNumber, aByteIndex );
144 void init(
const wxString& aProblem,
const char* aThrowersFile,
145 const char* aThrowersFunction,
int aThrowersLineNumber,
146 const wxString& aSource,
const char* aInputLine,
147 int aLineNumber,
int aByteIndex );
165#define THROW_PARSE_ERROR( aProblem, aSource, aInputLine, aLineNumber, aByteIndex ) \
166 throw PARSE_ERROR( aProblem, __FILE__, __FUNCTION__, __LINE__, aSource, aInputLine, \
167 aLineNumber, aByteIndex )
181 const wxString& aRequiredGenerator = wxEmptyString );
183 const wxString& aRequiredGenerator = wxEmptyString );
186 void init(
const wxString& aRequiredVersion,
187 const wxString& aRequiredGenerator = wxEmptyString );
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
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.
Hold a translatable error message and may be used when throwing exceptions containing a translated er...
KI_PARAM_ERROR(const wxString &aMessage)
Constructor.
const wxString What() const
virtual ~KI_PARAM_ERROR()
A filename or source description, a problem input line, a line number, a byte offset,...
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