Nuitrack  1.11.2
3D Skeleton Tracking Middleware
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events Groups Pages
ExceptionToError.h
1 #ifndef NUITRACK_EXCEPTION_TO_NUITRACK_ERROR_H_
2 #define NUITRACK_EXCEPTION_TO_NUITRACK_ERROR_H_
3 
4 #include "nuitrack/types/Error.h"
5 
6 namespace tdv
7 {
8 namespace nuitrack
9 {
10 
11 inline nuitrack_error* exceptionToNuitrackError(const Exception &e)
12 {
13  const auto message = e.what();
14 
15  switch(e.type())
16  {
17  case EXCEPTION:
18  return new nuitrack_error(new Exception(message));
20  return new nuitrack_error(new TerminateException(message));
22  return new nuitrack_error(new BadConfigValueException(message));
24  return new nuitrack_error(new ConfigNotFoundException(message));
26  return new nuitrack_error(new ModuleNotFoundException(message));
28  return new nuitrack_error(new LicenseNotAcquiredException(message));
30  return new nuitrack_error(new ModuleNotInitializedException(message));
32  return new nuitrack_error(new ModuleNotStartedException(message));
33  }
34 }
35 
36 } /* namespace nuitrack */
37 } /* namespace tdv */
38 
39 #endif /* NUITRACK_EXCEPTION_TO_NUITRACK_ERROR_H_ */
tdv::nuitrack::ModuleNotInitializedException
Definition: Error.h:29
tdv::nuitrack::ModuleNotFoundException
Definition: Error.h:27
tdv::nuitrack::ConfigNotFoundException
Definition: Error.h:26
tdv::nuitrack::TerminateException
Definition: Error.h:24
tdv::nuitrack::Exception
Definition: Error.h:23
tdv::nuitrack::BadConfigValueException
Definition: Error.h:25
tdv::nuitrack::ModuleNotStartedException
Definition: Error.h:30
tdv::nuitrack::LicenseNotAcquiredException
Definition: Error.h:28