From: Wolfgang Bangerth Date: Mon, 25 Jan 2021 21:58:36 +0000 (-0700) Subject: Nicely format exception texts. X-Git-Tag: v9.3.0-rc1~544^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01c12ce47049282e978c06980a54a3a216ac3534;p=dealii.git Nicely format exception texts. --- diff --git a/source/base/exceptions.cc b/source/base/exceptions.cc index e3d1e2bb5a..336abc2dbf 100644 --- a/source/base/exceptions.cc +++ b/source/base/exceptions.cc @@ -321,10 +321,25 @@ ExceptionBase::generate_message() const << "--------------------------------------------------------" << std::endl; - // print out general data + // Print out general data print_exc_data(converter); - // print out exception specific data - print_info(converter); + + // Print out exception specific data. Put this into another stringstream + // object for now so that we can break long lines and print them in a + // more easily read way + { + std::ostringstream message; + print_info(message); + + const auto message_in_lines = + Utilities::break_text_into_lines(message.str(), 70); + + // Put the message into the stream that will be output. + for (const auto &line : message_in_lines) + converter << " " << line << '\n'; + } + + print_stack_trace(converter); if (!deal_II_exceptions::internals::get_additional_assert_output()