More elaborate error reporting

This commit is contained in:
Thomas Krijnen
2016-06-12 11:22:08 +02:00
parent f4fd3a5ca1
commit be10bc46ca
4 changed files with 69 additions and 14 deletions
+11 -2
View File
@@ -6,8 +6,17 @@
if ( convert((T*)l,r) ) { \
success = true; \
} \
} catch(...) { } \
if ( !success) { \
} catch (const std::exception& e) { \
Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l->entity); \
return false; \
} catch (const Standard_Failure& f) { \
if (f.GetMessageString()) \
Logger::Message(Logger::LOG_ERROR, std::string("Error in: ") + f.GetMessageString() + "\nFailed to convert:", l->entity); \
else \
Logger::Message(Logger::LOG_ERROR, "Failed to convert:", l->entity); \
return false; \
} \
if (!success) { \
Logger::Message(Logger::LOG_ERROR,"Failed to convert:",l->entity); \
return false; \
} \
+8 -2
View File
@@ -3,8 +3,14 @@
if ( l->is(T::Class()) ) { \
try { \
return convert((T*)l,r); \
} catch (...) { } \
Logger::Message(Logger::LOG_ERROR,"Failed to convert:",l->entity); \
} catch (const std::exception& e) { \
Logger::Message(Logger::LOG_ERROR, std::string(e.what()) + "\nFailed to convert:", l->entity); \
} catch (const Standard_Failure& f) { \
if (f.GetMessageString()) \
Logger::Message(Logger::LOG_ERROR, std::string("Error in: ") + f.GetMessageString() + "\nFailed to convert:", l->entity); \
else \
Logger::Message(Logger::LOG_ERROR, "Failed to convert:", l->entity); \
} \
return false; \
}
#include "IfcRegisterDef.h"