void Logging::exceptionMessage(const exception & e, const int err_no) { cerr << "\nERROR: " << e.what() << std::endl << flush; ERROR_LOG << "Top level exception: " << e.what() << std::endl << flush; releaseFile(); exit(err_no); }
HPX_ATTRIBUTE_NORETURN void rethrow_exception( exception const& e, std::string const& func) { hpx::detail::throw_exception( hpx::exception(e.get_error(), e.what(), hpx::rethrow), func, hpx::get_error_file_name(e), hpx::get_error_line_number(e)); }
wstring StringConverter::ToExceptionString (const exception &ex) { const SystemException *sysEx = dynamic_cast <const SystemException *> (&ex); if (sysEx) return ToWide (sysEx->what()) + L": " + sysEx->SystemText() + L": " + sysEx->GetSubject(); if (ex.what() && !string (ex.what()).empty()) return ToWide (GetTypeName (typeid (ex)) + ": " + ex.what()); return ToWide (GetTypeName (typeid (ex))); }
void rethrows_if( hpx::error_code& ec, exception const& e, std::string const& func) { if (&ec == &hpx::throws) { hpx::detail::rethrow_exception(e, func); } else { ec = make_error_code(e.get_error(), e.what(), func.c_str(), hpx::get_error_file_name(e).c_str(), hpx::get_error_line_number(e), (ec.category() == hpx::get_lightweight_hpx_category()) ? hpx::lightweight_rethrow : hpx::rethrow); } }
void to_variant( const exception& e, variant& v, uint32_t max_depth ) { FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" ); variant v_log; to_variant( e.get_log(), v_log, max_depth - 1 ); mutable_variant_object tmp; tmp( "code", e.code() ) ( "name", e.name() ) ( "message", e.what() ) ( "stack", v_log ); v = variant( tmp, max_depth ); }
void error_log::log_unhandled(const char *func, const char *file, int line, const exception& x) { cerr << "unhandled exception! " << endl; cerr << x.what() << endl; cerr << "caught in " << func << ", at line " << line << " of " << file << endl; }
int cxxsp_engine::display_exception(request_rec *r, const exception& ex) { ap_set_content_type(r, "text/html"); if(!r->header_only) { ap_rputs(DOCTYPE_HTML_4_0T, r); ap_rputs("<html><head><title>C++ Server Pages: Exception</title></head>\n",r); ap_rputs("<body><h2>C++ Server Pages: Exception</h2>\n",r); ap_rprintf(r,"<p>An exception (%s) occured during generation/compilation " "of the C++ Server Page.</p>\n",typeid(ex).name()); ap_rputs("<p>Here is the detailed message:</p>\n",r); ap_rputs("<pre style=\"border: solid black 1px; padding: 3px\">",r); string msg = ex.what(); for(string::size_type i = 0; i<msg.size(); ++i) switch(msg[i]) { case '<': msg.replace(i,1,"<"); break; case '>': msg.replace(i,1,">"); break; case '&': msg.replace(i,1,"&"); break; default: break; } ap_rputs(msg.c_str(),r); ap_rputs("</pre>\n",r); ap_rputs("</body></html>",r); } return OK; }
void onError(const char* mod,exception& ex) { tprintf("error loading module %s: %s\n",mod,ex.what()); cppsp::CompileException* ce = dynamic_cast<cppsp::CompileException*>(&ex); if (ce != NULL) { tprintf("compiler output:\n%s\n",ce->compilerOutput.c_str()); } }
int push_exception(lua_State * L, exception const & e) { exception ** mem = static_cast<exception**>(lua_newuserdata(L, sizeof(exception*))); // NOLINT *mem = e.clone(); luaL_getmetatable(L, exception_mt); lua_setmetatable(L, -2); return 1; }
void NO_RETURN exception_factory::rethrow( const exception& e )const { auto itr = _registered_exceptions.find( e.code() ); if( itr != _registered_exceptions.end() ) itr->second->rethrow( e ); throw e; }
void DisplayError(const exception& inErr) { if (typeid(inErr) == typeid(HError)) cerr << "Exception: " << static_cast<const HError&>(inErr).GetErrorString() << endl; else cerr << "Exception: " << inErr.what() << endl; }
void SessionImpl::failure( const shared_ptr< Session > session, const int status, const exception& error ) const { const auto handler = ( m_resource not_eq nullptr and m_resource->m_pimpl->m_error_handler not_eq nullptr ) ? m_resource->m_pimpl->m_error_handler : m_error_handler; if ( handler not_eq nullptr ) { handler( status, error, session ); } else { log( Logger::Level::ERROR, String::format( "Error %i, %s", status, error.what( ) ) ); string body = error.what( ); session->close( status, body, { { "Content-Type", "text/plain" }, { "Content-Length", ::to_string( body.length( ) ) } } ); } }
void exception::chainException(const exception& other) { exception* e = other.clone(); delete m_other; m_other = e; }
void exception::default_show_function (const exception& err) // Send a formatted report to standard error and to the Debug stream. { wstring s= err.What(); std::wcerr << s; // sic, should be werr. const wchar_t* buffer= s.c_str(); ratwin::util::OutputDebugString (buffer); }
BINLINE BException::BException(const exception& ex) throw() { const BException* bex = dynamic_cast<const BException*>(&ex); if (bex) { data = bex->data; } else { init(BExceptionC::INTERNAL, L"", L"", ex.what()); } }
void print_exception(const string &msg, const exception &e) { print_error_header(); cout << msg << ": "; setColor(BLUE); cout << e.what(); setColor(WHITE); cout << ".\n"; }
void exceptionMessage(const exception &excp) { string message, title; showCursor(true); message += "ERROR(S):\n\n"; message += excp.what(); title = "Error: Unhandled Exception"; MessageBox(NULL, message.c_str(), title.c_str(), MB_ICONSTOP | MB_OK | MB_TASKMODAL); }
void PopSessionCommand::Failure(const exception& exc) { MojLogError(m_log, "Exception in command %s: %s", Describe().c_str(), exc.what()); Cleanup(); m_session.CommandFailed(this, MailError::INTERNAL_ERROR, exc); MojRefCountedPtr<PopCommandResult> result = GetResult(); result->SetException(exc); result->Done(); }
void tls_set_error_info(exception const& exc) { error_record* rec = get_error_record(); JAG_ASSERT(rec); std::stringstream ss; output_exception(exc, ss); rec->m_message = ss.str(); rec->m_err_code = exc.errcode(); }
inline void ReportException( const exception& e, ostream& os ) { try { const ArgException& argExcept = dynamic_cast<const ArgException&>(e); if( string(argExcept.what()) != "" ) os << argExcept.what() << endl; DEBUG_ONLY(DumpCallStack(os)) } catch( exception& castExcept ) { if( string(e.what()) != "" ) { os << "Process " << mpi::WorldRank() << " caught error message:\n" << e.what() << endl; } DEBUG_ONLY(DumpCallStack(os)) mpi::Abort( mpi::COMM_WORLD, 1 ); } }
Record::Record(const string &fname, const uint32_t ln, const string &name, const exception &ex) : _filename(fname), _level(Level::OFF), _lineNumber(ln), _loggerName(), _message(), _methodName(name), _thrownMessage(ex.what()) {}
/// <summary>Logs an STL exception to the console.</summary> /// <param name="src">Handler location</param> /// <param name="e">error</param> void ConsoleWnd::Log(const GuiString& src, const exception&e) { ConsoleLock lock; *this << ENDL << Cons::Exception << L"STL EXCEPTION: " << Cons::Error << e.what() << Cons::White << L"... Source: " << Cons::Yellow << src << ENDL; }
void print_and_clear_exception(const string& where, const exception& error) { #ifdef GEODE_PYTHON if (typeid(error)==typeid(PythonError)) { cerr << where << ':' << endl; PyErr_Print(); return; } #endif cerr << where << ": " << typeid(error).name() << ", " << error.what() << endl; }
string getMessage(const exception& e) { string result(e.what()); try { rethrow_if_nested(e); } catch (const exception& innerException) { result += "\n" + getMessage(innerException); } catch (...) {} return result; }
void DisplayError( const exception& inErr) { { StOKToThrow ok; PlaySound("error"); } try { DisplayAlert("exception-alert", inErr.what()); } catch (...) { GtkWidget* dlg = gtk_message_dialog_new(nil, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_NONE, "%s", inErr.what()); gtk_dialog_run(GTK_DIALOG(dlg)); gtk_widget_destroy(dlg); } }
void DisplayError(const exception& inErr) { try { if (typeid(inErr) == typeid(HError)) HAlerts::Alert(nil, 205, static_cast<const HError&>(inErr).GetErrorString()); else HAlerts::Alert(nil, 205, inErr.what()); } catch (...) {} }
void FactoryACMMonitor::handleException(const exception& ex) { Lock sync(*this); if(!_instance) { return; } Error out(_instance->initializationData().logger); out << "exception in connection monitor:\n" << ex.what(); }
void EvalThread::exceptionInEval(exception &e) { // 2006-0-09 AF, try to reconnect to OMC first. try { delegate_->closeConnection(); delegate_->reconnect(); run(); } catch( exception &e ) { // unable to reconnect, ask if user want to restart omc. QString msg = QString( e.what() ) + "\n\nUnable to reconnect with OMC. Do you want to restart OMC?"; int result = QMessageBox::critical( 0, tr("Communication Error with OMC"), msg, QMessageBox::Yes | QMessageBox::Default, QMessageBox::No ); if( result == QMessageBox::Yes ) { delegate_->closeConnection(); if( delegate_->startDelegate() ) { // 2006-03-14 AF, wait before trying to reconnect, // give OMC time to start up msleep(1000); try { delegate_->reconnect(); run(); } catch( exception &e ) { e.what(); QMessageBox::critical( 0, tr("Communication Error"), tr("<B>Unable to communication correctlly with OMC.</B>") ); } } } } }
void ConnectCommand::ConnectFailure(const exception& e) { CommandTraceFunction(); MojLogError(m_log, "error connecting to server: %s", e.what()); if(m_connection.get()) { m_connection->Shutdown(); } m_session.ConnectFailure(e); Failure(e); }
/*! @brief 'Handles an unhandled exception; logs the backtrace to errorlog @param e the exception */ void unhandledExceptionHandler(exception& e) { //!< @todo TODO: check whether the exception is serious, if it is fail safely errorlog << "UNHANDLED EXCEPTION. " << endl; void *array[10]; size_t size; char **strings; size = backtrace(array, 10); strings = backtrace_symbols(array, size); for (size_t i=0; i<size; i++) errorlog << strings[i] << endl; errorlog << e.what() << endl; }