X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fsupport%2FExceptionMessage.h;h=0bf59e58a232d9ab35548fe2a503f318a48b3ab9;hb=70d88f02e757724ae4c1524b7b95b7a462416ca2;hp=9b752be029e5351d73ebf675e01b913fd2c6502b;hpb=753d2cafa5a475477a56d97f658a914c1aa2d1b3;p=lyx.git diff --git a/src/support/ExceptionMessage.h b/src/support/ExceptionMessage.h index 9b752be029..0bf59e58a2 100644 --- a/src/support/ExceptionMessage.h +++ b/src/support/ExceptionMessage.h @@ -8,9 +8,6 @@ * * Full author contact details are available in file CREDITS. * - * A store of the paths to the various different directoies used - * by LyX. These paths differ markedly from one OS to another, - * following the local Windows, MacOS X or Posix conventions. */ #ifndef LYX_MESSAGE_H #define LYX_MESSAGE_H @@ -22,9 +19,26 @@ namespace lyx { namespace support { +/// LyX support three types of custom exceptions. In order of +/// increasing seriousness, these are: +/// +/// WarningException +/// Intended for unexpected situations that we do not expect +/// to compromise further operation. It has the effect of +/// aborting whatever operation in in process. +/// +/// BufferException +/// Intended for situations that indicate some problem with a +/// Buffer or its related data structures. The Buffer will be +/// closed, in emergency style. +/// +/// ErrorException +/// Intended for situations that indicate a global problem +/// with the program. It will lead to an emergency shutdown. enum ExceptionType { ErrorException, + BufferException, WarningException }; @@ -34,7 +48,7 @@ public: ExceptionMessage(ExceptionType type, docstring const & title, docstring const & details) : type_(type), title_(title), details_(details), - message_(to_utf8(title_ + '\n' + details_)) {} + message_(to_utf8(title_ + docstring::value_type('\n') + details_)) {} virtual const char * what() const throw() { return message_.c_str(); } virtual ~ExceptionMessage() throw() {}