mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-12-15 07:20:17 +00:00
shm: Improve error message when segment cannot be opened
This commit is contained in:
@@ -151,7 +151,8 @@ class Manager
|
|||||||
<< " Allocation algorithm: " << allocationAlgorithm;
|
<< " Allocation algorithm: " << allocationAlgorithm;
|
||||||
LOG(debug) << ss.str();
|
LOG(debug) << ss.str();
|
||||||
} catch(interprocess_exception& bie) {
|
} catch(interprocess_exception& bie) {
|
||||||
LOG(error) << "something went wrong: " << bie.what();
|
LOG(error) << "Failed to create/open shared memory segment (" << "fmq_" << fShmId << "_m_" << fSegmentId << "): " << bie.what();
|
||||||
|
throw std::runtime_error(tools::ToString("Failed to create/open shared memory segment (", "fmq_", fShmId, "_m_", fSegmentId, "): ", bie.what()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mlockSegment) {
|
if (mlockSegment) {
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <memory> // unique_ptr, make_unique
|
#include <memory> // unique_ptr, make_unique
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace fair::mq::shmem
|
namespace fair::mq::shmem
|
||||||
{
|
{
|
||||||
@@ -84,6 +85,9 @@ class TransportFactory final : public fair::mq::TransportFactory
|
|||||||
} catch (boost::interprocess::interprocess_exception& e) {
|
} catch (boost::interprocess::interprocess_exception& e) {
|
||||||
LOG(error) << "Could not initialize shared memory transport: " << e.what();
|
LOG(error) << "Could not initialize shared memory transport: " << e.what();
|
||||||
throw std::runtime_error(tools::ToString("Could not initialize shared memory transport: ", e.what()));
|
throw std::runtime_error(tools::ToString("Could not initialize shared memory transport: ", e.what()));
|
||||||
|
} catch (const std::exception& e) {
|
||||||
|
LOG(error) << "Could not initialize shared memory transport: " << e.what();
|
||||||
|
throw std::runtime_error(tools::ToString("Could not initialize shared memory transport: ", e.what()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user