use exceptions instead of hard abort

This commit is contained in:
Dennis Luxen
2013-08-05 17:28:57 +02:00
parent ec7d3a9885
commit 54302a53e1
23 changed files with 248 additions and 193 deletions
+1 -11
View File
@@ -31,6 +31,7 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include "../Plugins/ViaRoutePlugin.h"
#include "../Plugins/RouteParameters.h"
#include "../Util/BaseConfiguration.h"
#include "../Util/OSRMException.h"
#include "../Util/InputFileUtil.h"
#include "../Server/BasicDatastructures.h"
@@ -39,19 +40,8 @@ or see http://www.gnu.org/licenses/agpl.txt.
#include <boost/noncopyable.hpp>
#include <boost/thread.hpp>
#include <exception>
#include <vector>
class OSRMException: public std::exception {
public:
OSRMException(const char * message) : message(message) {}
private:
virtual const char* what() const throw() {
return message;
}
const char * message;
};
class OSRM : boost::noncopyable {
typedef boost::unordered_map<std::string, BasePlugin *> PluginMap;
QueryObjectsStorage * objects;