crocoddyl  1.6.0
Contact RObot COntrol by Differential DYnamic programming Library (Crocoddyl)
exception.cpp
1 // BSD 3-Clause License
3 //
4 // Copyright (C) 2019-2020, University of Edinburgh
5 // Copyright note valid unless otherwise stated in individual files.
6 // All rights reserved.
8 
9 #include "crocoddyl/core/utils/exception.hpp"
10 
11 namespace crocoddyl {
12 
13 Exception::Exception(const std::string &msg, const char *file, const char *func, int line) {
14  std::stringstream ss;
15  ss << "In " << file << "\n";
16  ss << func << " ";
17  ss << line << "\n";
18  ss << msg;
19  msg_ = ss.str();
20 }
21 
22 Exception::~Exception() NOEXCEPT {}
23 
24 const char *Exception::what() const NOEXCEPT { return msg_.c_str(); }
25 
26 } // namespace crocoddyl