8 #ifndef __LIDAR_ERROR_H__
9 #define __LIDAR_ERROR_H__
14 LT_BEGIN_LIDAR_NAMESPACE
17 #define THROW_LIBRARY_ERROR(code) \
18 throw LizardTech::Error(__FILE__, __FUNCTION__, __LINE__, code)
21 #define THROW_OS_ERROR() \
22 throw LizardTech::OSError(__FILE__, __FUNCTION__, __LINE__)
27 class Error :
public std::exception
42 Error(
const char *file,
const char *func,
int line,
int code)
throw();
55 const char *
function(void)
const throw();
61 int line(
void)
const throw();
74 const char *
what(
void)
const throw();
115 LT_END_LIDAR_NAMESPACE
Error is the base class for all LiDAR SDK errors.
const char * filename(void) const
Get the file name.
int error(void) const
Get the error code.
Error & operator()(const char *fmt,...)
Append more text the error discription.
Error(const char *file, const char *func, int line, int code)
Construct an error exception.
int line(void) const
Get the line number.
const char * what(void) const
Get the text description.
OSError extends Error by using errno or GetLastError() to build the text description of the error.
OSError(const char *file, const char *func, int line)
Construct an OS error exception.