Boost logo

Boost Users :

Subject: [Boost-users] [MSM] state transitions and exceptions
From: Stephan Menzel (stephan.menzel_at_[hidden])
Date: 2012-03-29 04:55:17


I did just get around to give the MSM a first shot and I have say I am
impressed at the neat design, the ease of use, "understandability",
tutorial ... exceptional work. Really great and it helped me a great
deal so far. So thanks a bunch for this teriffic addition to boost.
That's the kind of stuff I love boost for.

There is one question however that puzzles me. How can / do I prevent
state transistions when a transition function throws?

Most transition functions are defined like that:

void so_transition(event::Cause const &e) {


The tutorial only mentions this at the very end of the back-end docs
and this is not clear to me. I have stuff inside my transitions that
may throw and the example text mentiones other valid examples (like
connect() logic). So what am I supposed to do here?


void so_transition(event::Cause const &e) {
  try {
  } catch (const std::exception &sex) {
     return ???

The type is void and I can't return anything that would prevent the transition.
Or should I just let the exception pass? What is the correct way?

Suggestions are appreciated,


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at