diff options
author | Chris Wilson <chris+github@qwirx.com> | 2009-07-05 21:45:35 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2009-07-05 21:45:35 +0000 |
commit | 5e7661697143252fbfe9667c214b5f224489cf27 (patch) | |
tree | 2555ba8f13a8d8807d0d3acebcc8b51e2716104e /lib/common/Box.h | |
parent | c184849dc3b79d631fb5f279c9868e5a6bc05990 (diff) |
Suppress exception warnings when they are expected during a test.
Diffstat (limited to 'lib/common/Box.h')
-rw-r--r-- | lib/common/Box.h | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/common/Box.h b/lib/common/Box.h index 1124a062..77f7d1f4 100644 --- a/lib/common/Box.h +++ b/lib/common/Box.h @@ -103,18 +103,25 @@ #define THROW_EXCEPTION(type, subtype) \ { \ - OPTIONAL_DO_BACKTRACE \ - BOX_WARNING("Exception thrown: " #type "(" #subtype ") " \ - "at " __FILE__ "(" << __LINE__ << ")") \ + if(!HideExceptionMessageGuard::ExceptionsHidden()) \ + { \ + OPTIONAL_DO_BACKTRACE \ + BOX_WARNING("Exception thrown: " \ + #type "(" #subtype ") " \ + "at " __FILE__ "(" << __LINE__ << ")") \ + } \ throw type(type::subtype); \ } #define THROW_EXCEPTION_MESSAGE(type, subtype, message) \ { \ - OPTIONAL_DO_BACKTRACE \ - BOX_WARNING("Exception thrown: " #type "(" #subtype ") " \ - " (" message ") at " \ - __FILE__ "(" << __LINE__ << ")") \ + if(!HideExceptionMessageGuard::ExceptionsHidden()) \ + { \ + OPTIONAL_DO_BACKTRACE \ + BOX_WARNING("Exception thrown: " \ + #type "(" #subtype ") (" message ") at " \ + __FILE__ "(" << __LINE__ << ")") \ + } \ throw type(type::subtype, message); \ } |