Revision 565, 0.8 kB
(checked in by vbarta, 15 years ago)
|
using own error macros (basically copied from IT++, but never aborting)
|
Rev | Line | |
---|
[565] | 1 | #include "bdmerror.h" |
---|
| 2 | #include <iostream> |
---|
| 3 | #include <iomanip> |
---|
| 4 | #include <stdexcept> |
---|
| 5 | |
---|
| 6 | namespace bdm { |
---|
| 7 | |
---|
| 8 | void bdm_assert_f(const std::string &ass, const std::string &msg, const std::string &file, int line) { |
---|
| 9 | std::ostringstream error; |
---|
| 10 | error << "*** Assertion failed in " << file << " on line " << line |
---|
| 11 | << ":\n" << msg << " (" << ass << ")\n"; |
---|
| 12 | throw std::runtime_error (error.str() ); |
---|
| 13 | } |
---|
| 14 | |
---|
| 15 | void bdm_error_f(const std::string &msg, const std::string &file, int line) { |
---|
| 16 | std::ostringstream error; |
---|
| 17 | error << "*** Error in " << file << " on line " << line << ":\n" |
---|
| 18 | << msg << "\n"; |
---|
| 19 | throw std::runtime_error (error.str() ); |
---|
| 20 | } |
---|
| 21 | |
---|
| 22 | void bdm_warning_f(const std::string &msg, const std::string &file, int line) { |
---|
| 23 | std::cerr << "*** Warning in " << file << " on line " << line << ":\n" |
---|
| 24 | << msg << std::endl; |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | } |
---|