Skip to content
Snippets Groups Projects
Commit bed6e32e authored by samuel.hayden's avatar samuel.hayden
Browse files

Added error code and messages related to command line

parent 45c633da
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#define RETURN_MSG std::cout << "[Info] Press enter to exit" << std::endl; \ #define RETURN_MSG std::cout << "[Info] Press enter to exit" << std::endl; \
std::cin.get() std::cin.get()
#define ERROR_MSG(function, code) std::cout << "[Error](" << function << ") code: " << (int)code << " - " << errorcode2string(code) << std::endl #define ERROR_MSG(function, code) std::cout << "[Error](" << function << ") code: " << (int)code << " - " << errorcode2string(code) << std::endl
#define ERROR_MSG_SUP(function, code, sup) std::cout << "[Error](" << function << ") code: " << (int)code << " - " << errorcode2string(code) << " " << sup << std::endl
enum ErrorCodes { enum ErrorCodes {
NoError = 0, NoError = 0,
...@@ -10,6 +11,7 @@ enum ErrorCodes { ...@@ -10,6 +11,7 @@ enum ErrorCodes {
StrutRadiusNotDefined, StrutRadiusNotDefined,
CantDetermineLatticeType, CantDetermineLatticeType,
LatticeTypeNotDefined, LatticeTypeNotDefined,
InvalidArgument,
FailedToMergeCells, FailedToTrimLattice, FailedToMergeCells, FailedToTrimLattice,
LatticeIsNull, BoundingBoxIsNull, LatticeIsNull, BoundingBoxIsNull,
...@@ -29,6 +31,7 @@ constexpr const char* errorcode2string(const ErrorCodes code) ...@@ -29,6 +31,7 @@ constexpr const char* errorcode2string(const ErrorCodes code)
case FailedToTrimLattice: return "FAILED_TO_TRIM_LATTICE"; case FailedToTrimLattice: return "FAILED_TO_TRIM_LATTICE";
case LatticeIsNull: return "LATTICE_IS_NULL"; case LatticeIsNull: return "LATTICE_IS_NULL";
case BoundingBoxIsNull: return "BOUNDING_BOX_IS_NULL"; case BoundingBoxIsNull: return "BOUNDING_BOX_IS_NULL";
case InvalidArgument: return "INVALID_ARGUMENT";
default: return "UNKNOWN_ERROR_OCCURED"; default: return "UNKNOWN_ERROR_OCCURED";
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment