42 #include <boost/current_function.hpp>
43 #include <pcl/pcl_exports.h>
51 #define PCL_THROW_EXCEPTION(ExceptionName, message) \
53 std::ostringstream s; \
55 throw ExceptionName(s.str(), __FILE__, BOOST_CURRENT_FUNCTION, __LINE__); \
71 const char* file_name =
nullptr,
72 const char* function_name =
nullptr,
73 unsigned line_number = 0)
74 : std::runtime_error (createDetailedMessage (error_description,
78 , file_name_ (file_name)
79 , function_name_ (function_name)
80 , line_number_ (line_number)
92 return (function_name_);
98 return (line_number_);
111 const char* file_name,
112 const char* function_name,
113 unsigned line_number)
115 std::ostringstream sstream;
116 if (function_name !=
nullptr)
117 sstream << function_name <<
" ";
119 if (file_name !=
nullptr)
121 sstream <<
"in " << file_name <<
" ";
122 if (line_number != 0)
123 sstream <<
"@ " << line_number <<
" ";
125 sstream <<
": " << error_description;
127 return (sstream.str ());
143 const char* file_name =
nullptr,
144 const char* function_name =
nullptr,
145 unsigned line_number = 0)
146 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
157 const char* file_name =
nullptr,
158 const char* function_name =
nullptr,
159 unsigned line_number = 0)
160 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
172 const char* file_name =
nullptr,
173 const char* function_name =
nullptr,
174 unsigned line_number = 0)
175 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
186 const char* file_name =
nullptr,
187 const char* function_name =
nullptr,
188 unsigned line_number = 0)
189 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
200 const char* file_name =
nullptr,
201 const char* function_name =
nullptr,
202 unsigned line_number = 0)
203 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
215 const char* file_name =
nullptr,
216 const char* function_name =
nullptr,
217 unsigned line_number = 0)
218 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
229 const char* file_name =
nullptr,
230 const char* function_name =
nullptr,
231 unsigned line_number = 0)
232 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
239 const char* file_name =
nullptr,
240 const char* function_name =
nullptr,
241 unsigned line_number = 0)
242 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
249 const char* file_name =
nullptr,
250 const char* function_name =
nullptr,
251 unsigned line_number = 0)
252 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
262 const char* file_name =
nullptr,
263 const char* function_name =
nullptr,
264 unsigned line_number = 0)
265 :
pcl::
PCLException (error_description, file_name, function_name, line_number) { }
An exception that is thrown when the arguments number or type is wrong/unhandled.
BadArgumentException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
ComputeFailedException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception that is thrown during an IO error (typical read/write errors)
IOException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception thrown when init can not be performed should be used in all the PCLBase class inheritant...
InitFailedException(const std::string &error_description="", const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception that is thrown when a PCLPointCloud2 message cannot be converted into a PCL type.
InvalidConversionException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception that is thrown when a sample consensus model doesn't have the correct number of samples ...
InvalidSACModelTypeException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception that is thrown when a PointCloud is not dense but is attempted to be used as dense.
IsNotDenseException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception that is thrown when the kernel size is too small.
KernelWidthTooSmallException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
A base class for all pcl exceptions which inherits from std::runtime_error.
const char * detailedMessage() const noexcept
const char * getFileName() const noexcept
PCLException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
static std::string createDetailedMessage(const std::string &error_description, const char *file_name, const char *function_name, unsigned line_number)
const char * getFunctionName() const noexcept
const char * function_name_
unsigned getLineNumber() const noexcept
UnhandledPointTypeException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)
An exception that is thrown when an organized point cloud is needed but not provided.
UnorganizedPointCloudException(const std::string &error_description, const char *file_name=nullptr, const char *function_name=nullptr, unsigned line_number=0)