26#include <wx/translation.h>
33 return wxString( wxS(
"IO_ERROR: " ) ) +
Problem() + wxS(
"\n\n" ) +
Where();
53 const char* aThrowersFunction,
int aThrowersLineNumber )
59 wxString srcname = aThrowersFile;
63 where.Printf( wxS(
"from %s : %s() line %d" ),
64 srcname.AfterLast(
'/' ),
65 wxString( aThrowersFunction ),
66 aThrowersLineNumber );
72 return problem.utf8_str().data();
77 const char* aThrowersFunction,
int aThrowersLineNumber,
78 const wxString& aSource,
const char* aInputLine,
int aLineNumber,
83 problem.Printf(
_(
"%s in '%s', line %d, offset %d." ),
95 wxString srcname = aThrowersFile;
99 where.Printf( wxS(
"from %s : %s() line %d" ),
100 srcname.AfterLast(
'/' ),
101 wxString( aThrowersFunction ),
102 aThrowersLineNumber );
107 const wxString& aRequiredGenerator )
114 problem.Printf(
_(
"KiCad was unable to open this file because it was created with a more "
115 "recent version than the one you are running.\n\n"
116 "To open it you will need to upgrade KiCad to a version dated %s or "
122 problem.Printf(
_(
"KiCad was unable to open this file because it was created with a more "
123 "recent version than the one you are running.\n\n"
124 "To open it you will need to upgrade KiCad to version %s or "
125 "later (file format dated %s or later)." ),
126 aRequiredGenerator, aRequiredVersion );
132 const wxString& aRequiredGenerator ) :
135 init( aRequiredVersion, aRequiredGenerator );
143 const wxString& aRequiredVersion,
144 const wxString& aRequiredGenerator ) :
155 init( aRequiredVersion, aRequiredGenerator );
157 if( !aParseError.
Problem().IsEmpty() )
158 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)