diff --git a/clients/roscpp/src/libros/spinner.cpp b/clients/roscpp/src/libros/spinner.cpp index 8941c3e66b..7842a01a5c 100644 --- a/clients/roscpp/src/libros/spinner.cpp +++ b/clients/roscpp/src/libros/spinner.cpp @@ -113,8 +113,7 @@ struct SpinnerMonitor SpinnerMonitor spinner_monitor; const std::string DEFAULT_ERROR_MESSAGE = - "Attempt to spin a callback queue from two spinners, one of them being single-threaded. " - "This will probably result in callbacks being executed out-of-order."; + "Attempt to spin a callback queue from two spinners, one of them being single-threaded."; } namespace ros @@ -130,8 +129,9 @@ void SingleThreadedSpinner::spin(CallbackQueue* queue) if (!spinner_monitor.add(queue, true)) { - ROS_FATAL_STREAM("SingleThreadedSpinner: " << DEFAULT_ERROR_MESSAGE); - throw std::runtime_error("There is already another spinner on this queue"); + std::string errorMessage = "SingleThreadedSpinner: " + DEFAULT_ERROR_MESSAGE + " You might want to use a MultiThreadedSpinner instead."; + ROS_FATAL_STREAM(errorMessage); + throw std::runtime_error(errorMessage); } ros::WallDuration timeout(0.1f); @@ -220,8 +220,9 @@ void AsyncSpinnerImpl::start() if (!spinner_monitor.add(callback_queue_, false)) { - ROS_FATAL_STREAM("AsyncSpinnerImpl: " << DEFAULT_ERROR_MESSAGE); - throw std::runtime_error("There is already a single-threaded spinner on this queue"); + std::string errorMessage = "AsyncSpinnerImpl: " + DEFAULT_ERROR_MESSAGE; + ROS_FATAL_STREAM(errorMessage); + throw std::runtime_error(errorMessage); } continue_ = true;