FluxioException.h
Go to the documentation of this file.
1#pragma once
2
3#include <optional>
4#include <string>
5
8
9#include <RobotAPI/interface/skills/SkillManagerInterface.h>
10
12{
20
21 /**
22 * @brief A base class for skill exceptions. All skill exceptions inherit from this class
23 */
24 class FluxioException : public armarx::LocalException
25 {
26 private:
27 const std::string message;
29 std::vector<std::string> contextList;
30
31 public:
32 FluxioException() = delete;
33
34 FluxioException(const std::string& message,
35 const FluxioExceptionType& type,
36 const std::vector<std::string>& contextList = {}) :
37 message(message), type(type), contextList(contextList)
38 {
39 }
40
41 void addToContext(const std::optional<std::string>& contextItem = std::nullopt,
42 const std::optional<std::string>& className = std::nullopt,
43 const std::optional<std::string>& methodName = std::nullopt,
44 const std::optional<int>& line = std::nullopt);
45
46 static FluxioException create(const std::string& message,
47 const FluxioExceptionType& type,
48 const std::string& className,
49 const char* function,
50 int line);
51
52 skills::manager::dto::FluxioException toManagerIce() const;
53 static std::string FluxioExceptionTypeToString(const FluxioExceptionType& type);
54 };
55
56} // namespace armarx::skills::error
static FluxioException create(const std::string &message, const FluxioExceptionType &type, const std::string &className, const char *function, int line)
static std::string FluxioExceptionTypeToString(const FluxioExceptionType &type)
skills::manager::dto::FluxioException toManagerIce() const
FluxioException(const std::string &message, const FluxioExceptionType &type, const std::vector< std::string > &contextList={})
void addToContext(const std::optional< std::string > &contextItem=std::nullopt, const std::optional< std::string > &className=std::nullopt, const std::optional< std::string > &methodName=std::nullopt, const std::optional< int > &line=std::nullopt)