Skip to content

Commit

Permalink
parsing error taken into account
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainPlessis committed Dec 31, 2014
1 parent a18c9ef commit 194b3a5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/utilities/include/antioch/antioch_asserts.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@
#endif // NDEBUG


#define antioch_error() do { antioch_here(); ANTIOCH_THROW(Antioch::LogicError()); } while(0)
#define antioch_not_implemented() do { antioch_here(); ANTIOCH_THROW(Antioch::NotImplemented()); } while(0)
#define antioch_file_error(filename) do { antioch_here(); ANTIOCH_THROW(Antioch::FileError(filename)); } while(0)
#define antioch_unit_error(description) do { antioch_here(); ANTIOCH_THROW(Antioch::UnitError(description)); } while(0)
#define antioch_error() do { antioch_here(); ANTIOCH_THROW(Antioch::LogicError()); } while(0)
#define antioch_not_implemented() do { antioch_here(); ANTIOCH_THROW(Antioch::NotImplemented()); } while(0)
#define antioch_file_error(filename) do { antioch_here(); ANTIOCH_THROW(Antioch::FileError(filename)); } while(0)
#define antioch_unit_error(description) do { antioch_here(); ANTIOCH_THROW(Antioch::UnitError(description)); } while(0)
#define antioch_parsing_error(description) do { antioch_here(); ANTIOCH_THROW(Antioch::ParsingError(description)); } while(0)
#define antioch_parameter_required(parameter,defaultpar) \
do { std::cerr << "\n*** Warning, The parameter " << parameter << " is not provided\n" \
<< "default parameter is " << defaultpar << std::endl \
Expand Down
11 changes: 11 additions & 0 deletions src/utilities/include/antioch/antioch_exceptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,17 @@ namespace Antioch
{}
};

/*!
* A class representing error while parsing
*/
class ParsingError : public std::runtime_error
{
public:
ParsingError(const std::string &description)
: std::runtime_error (description)
{}
};

} // end namespace Antioch

#define ANTIOCH_THROW(e) do { throw e; } while (0)
Expand Down

0 comments on commit 194b3a5

Please sign in to comment.