throw an exception instead of false asserts

This commit is contained in:
Dennis Luxen 2014-10-14 12:52:11 +02:00
parent 0a0099fb41
commit 1fc1e9590a

View File

@ -27,6 +27,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "simple_logger.hpp"
#include "OSRMException.h"
#include <boost/assert.hpp>
#include <cstdio>
@ -97,7 +99,7 @@ std::ostringstream &SimpleLogger::Write(LogLevel l)
#endif
break;
default:
BOOST_ASSERT_MSG(false, "should not happen");
throw OSRMException("unkown logging state");
break;
}
os << "] ";
@ -130,7 +132,7 @@ SimpleLogger::~SimpleLogger()
#endif
break;
default:
BOOST_ASSERT_MSG(false, "should not happen");
throw OSRMException("unkown logging state");
break;
}
}