void JointTrajGeneratorRML::handleSampleError(const std::runtime_error &err)
{
  RTT::log(RTT::Error) << "Error while sampling trajectory: " << err.what() << RTT::endlog();

  // Enter error state
  this->error();
}
Пример #2
0
void ShowAlert(const std::string message, const std::runtime_error& error) {
    std::string alertMessage = std::string(message).append("\n\nCause: ").append(error.what());
    CFStringRef cfTitle = CFStringCreateWithCString(NULL, "Oops something is wrong...", kCFStringEncodingUTF8);
    CFStringRef cfMessage = CFStringCreateWithCString(NULL, alertMessage.c_str(), kCFStringEncodingUTF8);
    CFUserNotificationDisplayNotice(0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL, cfTitle, cfMessage, NULL);
    CFRelease(cfTitle);
    CFRelease(cfMessage);
}
Пример #3
0
// --------------------------------------------------------------------------------------
//  Exception::RuntimeError   (implementations)
// --------------------------------------------------------------------------------------
Exception::RuntimeError::RuntimeError( const std::runtime_error& ex, const wxString& prefix )
{
	IsSilent = false;

	SetDiagMsg( pxsFmt( L"STL Runtime Error%s: %s",
		(prefix.IsEmpty() ? L"" : pxsFmt(L" (%s)", WX_STR(prefix)).c_str()),
		WX_STR(fromUTF8( ex.what() ))
	) );
}
Пример #4
0
// --------------------------------------------------------------------------------------
//  Exception::RuntimeError   (implementations)
// --------------------------------------------------------------------------------------
Exception::RuntimeError::RuntimeError( const std::runtime_error& ex, const wxString& prefix )
{
	IsSilent = false;

	const wxString msg( wxsFormat( L"STL Runtime Error%s: %s",
		(prefix.IsEmpty() ? prefix.c_str() : wxsFormat(L" (%s)", prefix.c_str()).c_str()),
		fromUTF8( ex.what() ).c_str()
	) );

	SetDiagMsg( msg );
}
Пример #5
0
void ErrorAdapter::displayErrorMessage(const std::string& function,
		const std::vector<std::string>& args, std::runtime_error& e) {
	std::string msg = "Runtime Exception was caught when loading file ";
	msg += function;
	msg += " '";
	msg += e.what();
	msg += "'";
	for (std::list<ErrorListener*>::iterator itr = m_listeners.begin();
			itr != m_listeners.end(); ++itr) {
		(*itr)->displayError(msg);
	}
}
Пример #6
0
void
handling_invalid_server(const std::string & db_type, const std::runtime_error& e, const std::string &collection,
                        const std::string &id)
{
  switch (ObjectDbParameters::StringToType(db_type))
  {
    case ObjectDbParameters::COUCHDB:
    {
      std::string url = "http://foo:12323";
      if (!collection.empty())
      {
        url.append("/" + collection);
        if (!id.empty())
          url.append("/" + id);
      };EXPECT_EQ(std::string(e.what()), std::string("No response from server. : ") + url);
      break;
    }
    case ObjectDbParameters::FILESYSTEM:
      EXPECT_EQ(std::string(e.what()), std::string("Path /bogus/path/for/testing does not exist. Please create."));
      break;
    default:
      throw std::runtime_error("Status test not implemented for " + db_type);
  }
}
Пример #7
0
int CImportManager::procErr(std::runtime_error& exc, const CString& sSupplierName, bool bIsLast)
{
	CString sFmt = LS (L_DOWNLOADS_IMPORT_HAS_BEEN_STOPPED);
	CString sTmp;
	sTmp.Format(sFmt, (LPCTSTR)sSupplierName);

	CString sMsg = sTmp;
	sMsg += " ";
	sMsg += exc.what();

	UINT nType = MB_ICONERROR;

	if (!bIsLast) {
		sMsg += " ";
		sMsg += LS (L_REQUEST_TO_CONTINUE_IMPORT);
		nType |= MB_YESNO;
	} else {
		nType |= MB_OK;
	}

	return ::MessageBox(m_hWizardWnd, (LPCTSTR)sMsg, LS (L_ERR), nType);
}
    } __TBB_CATCH( std::runtime_error& error ) {
#if TBB_USE_EXCEPTIONS
        REPORT("ERROR: %s\n", error.what() );
#endif /* TBB_USE_EXCEPTIONS */
    }
Пример #9
0
 void operator() (std::runtime_error const& e) const
 {
     std::cout << "std::runtime_error: " << e.what() << std::endl;
 }
Пример #10
0
void
psi::reportRuntimeError (std::runtime_error const &e)
{
    std::cerr << "Failed to locate file: " << e.what () << std::endl;
}
Пример #11
0
	void DebugFile::writeException(std::runtime_error& e) {
		_file << "(EXCEPTION) " << e.what() << std::endl;
	}
Пример #12
0
std::string Checker::prependContext( std::runtime_error& e, const char *name ) {
	std::string s = "\\";
	s.append( name );
	s.append( e.what() );
	return s;
}
Пример #13
0
bool is_error_500(std::runtime_error const & err)
{
	std::string msg = std::string(err.what());
	boost::algorithm::to_lower(msg);
	return msg.find("500 internal server error") != std::string::npos;
}
Пример #14
0
 bool operator() (const std::runtime_error& e) const {
     return std::string(e.what()).find(m_reason) != std::string::npos;
 };
Пример #15
0
void runtime_error_translator(std::runtime_error const & ex)
{
    PyErr_SetString(PyExc_RuntimeError, ex.what());
}
Пример #16
0
void
translate_std_runtime_error( std::runtime_error e)
{
	PyErr_SetString( PyExc_RuntimeError, e.what());
}