22#include <wx/translation.h>
29 return wxString( wxS(
"IO_ERROR: " ) ) +
Problem() + wxS(
"\n\n" ) +
Where();
49 const char* aThrowersFunction,
int aThrowersLineNumber )
55 wxString srcname = aThrowersFile;
59 where.Printf( wxS(
"from %s : %s() line %d" ),
60 srcname.AfterLast(
'/' ),
61 wxString( aThrowersFunction ),
62 aThrowersLineNumber );
68 return problem.utf8_str().data();
73 const char* aThrowersFunction,
int aThrowersLineNumber,
74 const wxString& aSource,
const char* aInputLine,
int aLineNumber,
79 problem.Printf(
_(
"%s in '%s', line %d, offset %d." ),
91 wxString srcname = aThrowersFile;
95 where.Printf( wxS(
"from %s : %s() line %d" ),
96 srcname.AfterLast(
'/' ),
97 wxString( aThrowersFunction ),
98 aThrowersLineNumber );
103 const wxString& aRequiredGenerator )
110 problem.Printf(
_(
"KiCad was unable to open this file because it was created with a more "
111 "recent version than the one you are running.\n\n"
112 "To open it you will need to upgrade KiCad to a version dated %s or "
118 problem.Printf(
_(
"KiCad was unable to open this file because it was created with a more "
119 "recent version than the one you are running.\n\n"
120 "To open it you will need to upgrade KiCad to version %s or "
121 "later (file format dated %s or later)." ),
122 aRequiredGenerator, aRequiredVersion );
128 const wxString& aRequiredGenerator ) :
131 init( aRequiredVersion, aRequiredGenerator );
139 const wxString& aRequiredVersion,
140 const wxString& aRequiredGenerator ) :
151 init( aRequiredVersion, aRequiredGenerator );
153 if( !aParseError.
Problem().IsEmpty() )
154 problem += wxS(
"\n\n" ) +
_(
"Full error text:" ) + wxS(
"\n" ) +
void init(const wxString &aProblem, const char *aThrowersFile, const char *aThrowersFunction, int aThrowersLineNumber)
virtual const wxString What() const
A composite of Problem() and Where()
virtual const wxString Problem() const
what was the problem?
virtual const char * what() const override
std::exception interface, returned as UTF-8
virtual const wxString Where() const
where did the Problem() occur?
int lineNumber
at which line number, 1 based index.
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)