summaryrefslogtreecommitdiff
path: root/lib/Exceptions.cc
diff options
context:
space:
mode:
authorPixel <Pixel>2001-11-12 19:49:16 +0000
committerPixel <Pixel>2001-11-12 19:49:16 +0000
commite57c35f00e5eba0ee5199997238cf3179a89c4d2 (patch)
tree6e734a152ec360c42b72e01948eb3e444a77f8bb /lib/Exceptions.cc
parent709543dec3eaa07f7d2d7da2157d1f9159bad5d8 (diff)
Plop
Diffstat (limited to 'lib/Exceptions.cc')
-rw-r--r--lib/Exceptions.cc30
1 files changed, 25 insertions, 5 deletions
diff --git a/lib/Exceptions.cc b/lib/Exceptions.cc
index 9d2ba8e..585b946 100644
--- a/lib/Exceptions.cc
+++ b/lib/Exceptions.cc
@@ -9,9 +9,21 @@
char GeneralException::t[BUFSIZ];
-GeneralException::GeneralException(String emsg) : msg(emsg.strdup()) { }
-GeneralException::GeneralException() : msg(0) { }
-GeneralException::GeneralException(const GeneralException & e) : msg(strdup(e.msg)) { }
+GeneralException::GeneralException(String emsg) : msg(emsg.strdup()) {
+#ifdef DEBUG
+ cerr << "Generating a General Exception error: '" << msg << "'.\n";
+#endif
+}
+GeneralException::GeneralException() : msg(0) {
+#ifdef DEBUG
+ cerr << "Generating a General Exception error: '" << msg << "'.\n";
+#endif
+}
+GeneralException::GeneralException(const GeneralException & e) : msg(strdup(e.msg)) {
+#ifdef DEBUG
+ cerr << "Generating a General Exception error: '" << msg << "'.\n";
+#endif
+}
GeneralException::~GeneralException() {
free(msg);
@@ -36,9 +48,17 @@ IOGeneral::IOGeneral(String fn) : GeneralException(fn) { }
IOGeneral::IOGeneral() { }
-IOAgain::IOAgain() : IOGeneral(_("No more bytes for reading or writing.")) { }
+IOAgain::IOAgain() : IOGeneral(_("No more bytes for reading or writing.")) {
+#ifdef DEBUG
+ cerr << "Generating an IOAgain exception: '" << GetMsg() << "'.\n";
+#endif
+}
-TaskSwitch::TaskSwitch() : GeneralException(_("Switching task in a non-tasked environnement")) { }
+TaskSwitch::TaskSwitch() : GeneralException(_("Switching task in a non-tasked environnement")) {
+#ifdef DEBUG
+ cerr << "Generating a TaskSwitch exception: '" << GetMsg() << "'.\n";
+#endif
+}
char * xstrdup(const char * s) throw (GeneralException) {
char * r;