Skip to content
Snippets Groups Projects
Commit bbde88d8 authored by Benedikt Engel's avatar Benedikt Engel
Browse files

new exception

parent 64ea9216
No related branches found
No related tags found
2 merge requests!452Resolve "Fluxio results and errors",!449Fluxio preliminary release
Pipeline #19137 passed
#include "FluxioException.h"
\ No newline at end of file
/*
* This file is part of ArmarX.
*
* Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
* Karlsruhe Institute of Technology (KIT), all rights reserved.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @author Fabian Peller-Konrad (fabian dot peller-konrad at kit dot edu)
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
// STD/STL
#include <list>
#include <map>
#include <string>
#include <vector>
// ArmarX
#include <ArmarXCore/core/exceptions/Exception.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
namespace armarx::skills::error
{
/**
* @brief A base class for skill exceptions. All skill exceptions inherit from this class
*/
class FluxioException : public armarx::LocalException
{
private:
std::string prettymethod;
std::list<std::string> contextList;
public:
std::string format(std::list<std::string> contextList) {
std::string message = "";
for(auto& s : contextList) {
message += s + "\n";
}
return message;
}
FluxioException() = delete;
FluxioException(const std::string& pretty, std::list<std::string> contextList = {}) : prettymethod(pretty)
{
}
void addToContext(const std::string& contextItem) {
contextList.push_back(contextItem);
}
const char* what() const noexcept override {
static std::string fullMessage;
fullMessage = prettymethod;
for (const auto& context : contextList) {
fullMessage += "\n" + context;
}
return fullMessage.c_str();
}
};
}; // namespace armarx::skills::error
#include "SkillManagerComponentPluginUser.h"
#include <Ice/Exception.h>
#include <IceUtil/Optional.h>
#include <ArmarXCore/core/logging/Logging.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment