Robot Dynamics Library
RdlExceptions.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Jordan Lack <jlack1987@gmail.com>
2 // RDL - Robot Dynamics Library
3 // Licensed under the zlib license. See LICENSE for more details.
4 
5 #ifndef __RDL_EXCEPTIONS_HPP__
6 #define __RDL_EXCEPTIONS_HPP__
7 
8 #include <stdexcept>
9 #include <exception>
10 
11 namespace RobotDynamics
12 {
17 class RdlException : public std::exception
18 {
19  public:
24  explicit RdlException(const std::string& err) : msg(err)
25  {
26  }
27 
28  virtual const char* what() const throw()
29  {
30  return msg.c_str();
31  }
32 
33  std::string msg ;
34 };
35 } // namespace RobotDynamics
36 #endif // ifndef __RDL_EXCEPTIONS_HPP__
A custom exception.
Definition: RdlExceptions.hpp:18
virtual const char * what() const
Definition: RdlExceptions.hpp:28
RdlException(const std::string &err)
Constructor.
Definition: RdlExceptions.hpp:24
std::string msg
Definition: RdlExceptions.hpp:33
Namespace for all structures of the RobotDynamics library.
Definition: examples.hpp:19