mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-29 14:32:51 -06:00
better error handling which always reports the right file name
This commit is contained in:
@@ -30,6 +30,35 @@ private:
|
||||
const char *msg;
|
||||
};
|
||||
|
||||
class PGF_INTERNAL_DECL pgf_systemerror : public std::runtime_error {
|
||||
public:
|
||||
pgf_systemerror(int code) : std::runtime_error("pgf_systemerror")
|
||||
{
|
||||
this->m_code = code;
|
||||
this->m_filepath = NULL;
|
||||
}
|
||||
|
||||
pgf_systemerror(int code, const char *filepath) : std::runtime_error("pgf_systemerror")
|
||||
{
|
||||
this->m_code = code;
|
||||
this->m_filepath = filepath;
|
||||
}
|
||||
|
||||
virtual int code() const
|
||||
{
|
||||
return m_code;
|
||||
}
|
||||
|
||||
const char *filepath() const
|
||||
{
|
||||
return m_filepath;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_code;
|
||||
const char *m_filepath;
|
||||
};
|
||||
|
||||
struct PGF_INTERNAL_DECL PgfFlag {
|
||||
PgfLiteral value;
|
||||
PgfText name;
|
||||
|
||||
Reference in New Issue
Block a user