[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [5982] Improve exception class added 20141011T1234Z
From: |
Greg Chicares |
Subject: |
[lmi-commits] [5982] Improve exception class added 20141011T1234Z |
Date: |
Sun, 12 Oct 2014 01:36:20 +0000 |
Revision: 5982
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5982
Author: chicares
Date: 2014-10-12 01:36:18 +0000 (Sun, 12 Oct 2014)
Log Message:
-----------
Improve exception class added 20141011T1234Z
Modified Paths:
--------------
lmi/trunk/ChangeLog
lmi/trunk/handle_exceptions.hpp
Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2014-10-11 12:34:33 UTC (rev 5981)
+++ lmi/trunk/ChangeLog 2014-10-12 01:36:18 UTC (rev 5982)
@@ -34305,3 +34305,9 @@
Add a GUI-testing exception class. See:
http://lists.nongnu.org/archive/html/lmi/2014-10/msg00036.html
+20141012T0136Z <address@hidden> [533]
+
+ handle_exceptions.hpp
+Improve exception class added 20141011T1234Z. See:
+ http://lists.nongnu.org/archive/html/lmi/2014-10/msg00043.html
+
Modified: lmi/trunk/handle_exceptions.hpp
===================================================================
--- lmi/trunk/handle_exceptions.hpp 2014-10-11 12:34:33 UTC (rev 5981)
+++ lmi/trunk/handle_exceptions.hpp 2014-10-12 01:36:18 UTC (rev 5982)
@@ -30,7 +30,7 @@
#include <cstdlib> // std::exit()
#include <exception>
-#include <string>
+#include <stdexcept>
/// This function, of type std::terminate_handler, is intended to be
/// used as the argument of std::set_terminate().
@@ -43,8 +43,9 @@
std::exit(EXIT_FAILURE);
}
-/// An extraordinary exception used only for testing the GUI.
+/// An extraordinary exception designed to elude report_exception().
///
+/// Motivating example: wx_test_exception derives from this class.
/// The production system (distributed to end users) is tested by
/// running its code under the supervision of the 'wx_test' program
/// (which is for developer use only)--in which case 'wx_test'
@@ -59,11 +60,11 @@
///
/// Implicitly-declared special member functions do the right thing.
-class wx_test_exception
- :public std::exception
+class stealth_exception
+ :public std::runtime_error
{
public:
- explicit wx_test_exception(std::string const& what_arg);
+ explicit stealth_exception(std::string const& what_arg);
};
/// Handle an uncaught exception, showing a description if available
@@ -85,7 +86,7 @@
/// "The only problem with uncaught_exception is that it doesn't
/// tell you when you're in a catch(...) { ... throw; } block"
///
-/// Simply rethrow when wx_test_exception is caught: see the comments
+/// Simply rethrow when stealth_exception is caught: see the comments
/// accompanying its declaration.
///
/// Show no message when hobsons_choice_exception is caught. It's
@@ -109,7 +110,7 @@
{
throw;
}
- catch(wx_test_exception const&)
+ catch(stealth_exception const&)
{
throw;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [5982] Improve exception class added 20141011T1234Z,
Greg Chicares <=