From 0acef5b2b2f62c5550c3f7c42a7e9a2e3f581621 Mon Sep 17 00:00:00 2001 From: jean-pierre roux Date: Thu, 4 Jun 2009 14:24:07 +0000 Subject: [PATCH] overload what() -for unaware users- --- src/creaException.h | 22 ++++++++++++++++------ src/creaWx.h | 1 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/creaException.h b/src/creaException.h index 81a2bd0..faae382 100644 --- a/src/creaException.h +++ b/src/creaException.h @@ -3,8 +3,8 @@ Program: crea Module: $RCSfile: creaException.h,v $ Language: C++ - Date: $Date: 2008/09/26 14:09:55 $ - Version: $Revision: 1.1 $ + Date: $Date: 2009/06/04 14:24:07 $ + Version: $Revision: 1.2 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -35,11 +35,11 @@ #define __creaException_h__ #include "creaSystem.h" +#include "creaMessageManager.h" #include namespace crea { - inline std::string bbGetObjectDescription() { return(""); } class CREA_EXPORT Exception : public std::exception @@ -51,8 +51,17 @@ namespace crea : mObject(object), mSourceFile(source_file), mMessage(message) - {} + { + mWhatMessage = " * ERROR : " + mMessage + + " * OBJECT : " + mObject + + " * FILE " + mSourceFile; + } ~Exception() throw() {} + virtual const char* what() const throw() + { + return mWhatMessage.c_str(); + } + void Print() throw() { std::cerr << "* ERROR : " << mMessage <