docstring formatHelper(docstring const & msg,
char const * expr, char const * file, long line)
{
- static const docstring d =
- from_ascii(N_("Assertion %1$s violated in\nfile: %2$s, line: %3$s"));
+ docstring const d = _("Assertion %1$s violated in\nfile: %2$s, line: %3$s");
+ LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
return bformat(d, from_ascii(expr), from_ascii(file),
convert<docstring>(line)) + '\n' + msg;
}
-void doWarnIf(char const * expr, docstring const & msg, char const * file, long line)
+void doWarnIf(char const * expr, char const * file, long line)
{
- LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
+ docstring const d = _("It should be safe to continue, but you\nmay wish to save your work and restart LyX.");
// comment this out if not needed
BOOST_ASSERT(false);
throw ExceptionMessage(WarningException, _("Warning!"),
- formatHelper(msg, expr, file, line));
+ formatHelper(d, expr, file, line));
}
-void doBufErr(char const * expr, docstring const & msg, char const * file, long line)
+void doBufErr(char const * expr, char const * file, long line)
{
- LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
+ docstring const d = _("There has been an error with this document.\nLyX will attempt to close it safely.");
// comment this out if not needed
BOOST_ASSERT(false);
throw ExceptionMessage(BufferException, _("Buffer Error!"),
- formatHelper(msg, expr, file, line));
+ formatHelper(d, expr, file, line));
}
-void doAppErr(char const * expr, docstring const & msg, char const * file, long line)
+void doAppErr(char const * expr, char const * file, long line)
{
- LYXERR0("ASSERTION " << expr << " VIOLATED IN " << file << ":" << line);
+ docstring const d = _("LyX has encountered an application error\nand will now shut down.");
// comment this out if not needed
BOOST_ASSERT(false);
throw ExceptionMessage(ErrorException, _("Fatal Exception!"),
- formatHelper(msg, expr, file, line));
+ formatHelper(d, expr, file, line));
}