Exception.cpp
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5 * Karlsruhe Institute of Technology (KIT), all rights reserved.
6 *
7 * ArmarX is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * ArmarX is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 *
19 * @author Fabian Peller-Konrad (fabian dot peller-konrad at kit dot edu)
20 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21 * GNU General Public License
22 */
23
24#include "Exception.h"
25
27 const std::string& reason) :
28 LocalException(prettymethod + ": " + reason + ".")
29{
30}
31
33 const std::string& reason,
34 const Path& path) :
35 LocalException(prettymethod + ": " + reason + ". The path was: " + path.toString())
36{
37}
38
40armarx::aron::error::AronException::operator()(const std::string& additionalMessage)
41{
42 auto currentReason = getReason();
43 if (not additionalMessage.empty())
44 {
45 setReason(currentReason + ". Additional Message: " + additionalMessage);
46 }
47 return *this;
48}
49
51 AronException(prettymethod,
52 "REACHED THE END OF A NON VOID METHOD. PERHAPS YOU FORGOT TO ADD A VALUE "
53 "TO SOME SWITCH-CASE STATEMEMT?.")
54{
55}
56
58 const std::string& prettymethod) :
59 AronException(prettymethod, "This method is not yet implemented!")
60{
61}
62
64 const std::string& prettymethod,
65 const std::string& reason,
66 const data::dto::GenericDataPtr& data) :
67 AronException(prettymethod, reason + ". The ice_id of the data was: " + data->ice_id())
68{
69}
70
72 const std::string& prettymethod,
73 const std::string& reason,
74 const data::dto::GenericDataPtr& data,
75 const Path& path) :
76 AronException(prettymethod, reason + ". The ice_id of the data was: " + data->ice_id(), path)
77{
78}
79
81 const std::string& prettymethod,
82 const std::string& reason,
83 const type::dto::GenericTypePtr& type) :
84 AronException(prettymethod, reason + ". The ice_id of the type was: " + type->ice_id())
85{
86}
87
89 const std::string& prettymethod,
90 const std::string& reason,
91 const type::dto::GenericTypePtr& type,
92 const Path& path) :
93 AronException(prettymethod, reason + ". The ice_id of the type was: " + type->ice_id(), path)
94{
95}
96
98 const std::string& reason,
99 const std::string& input) :
100 AronException(prettymethod, reason + ". Got: " + input)
101{
102}
103
105 const std::string& reason,
106 const std::string& input,
107 const Path& path) :
108 AronException(prettymethod, reason + ". Got: " + input, path)
109{
110}
111
113 const std::string& prettymethod,
114 const std::string& reason,
115 const std::string& input,
116 const std::string& expectation) :
117 AronException(prettymethod, reason + ". Got: " + input + ". Expected: " + expectation)
118{
119}
120
122 const std::string& reason,
123 const std::string& input,
124 const std::string& expectation,
125 const Path& path) :
126 AronException(prettymethod, reason + ". Got: " + input + ". Expected: " + expectation, path)
127{
128}
The Path class.
Definition Path.h:36
A base class for aron exceptions.
Definition Exception.h:37
AronException & operator()(const std::string &additionalMessage="")
call operator to append a message to the exception. Used by ARMARX_CHECK_AND_THROW
Definition Exception.cpp:40
A convenience header to include all aron files (full include, not forward declared)
A convenience header to include all aron files (full include, not forward declared)