Consider the case where there is not any layout name.
[lyx.git] / src / boost.C
blob10494e226ad8ed57d0d0c36101edfed264d08906
1 /**
2  * \file boost.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Lars Gullik Bjønnes
7  *
8  * Full author contact details are available in file CREDITS.
9  */
11 #include <config.h>
13 #include "lyx_main.h"
14 #include "debug.h"
15 #include "support/lyxlib.h"
17 #include <boost/assert.hpp>
19 #include <exception>
21 using std::endl;
23 namespace boost {
25 void throw_exception(std::exception const & e)
27         lyxerr << "Exception caught:\n"
28             << e.what() << endl;
29         BOOST_ASSERT(false);
33 namespace {
35 void emergencyCleanup()
37         static bool didCleanup;
38         if (didCleanup)
39                 return;
41         didCleanup = true;
43         LyX::cref().emergencyCleanup();
49 void assertion_failed(char const * expr, char const * function,
50                       char const * file, long line)
52         lyxerr << "Assertion triggered in " << function
53                << " by failing check \"" << expr << "\""
54                << " in file " << file << ":" << line << endl;
55         emergencyCleanup();
56         lyx::support::abort();