exceptions.cpp
Go to the documentation of this file.
1#include "exceptions.h"
2
4{
5 TrajectoryException::TrajectoryException(const std::string& msg) : std::logic_error(msg)
6 {
7 }
8
10 TrajectoryException("Interpolating between two different types.")
11 {
12 }
13
17
18 std::string
20 {
21 std::stringstream ss;
22 ss << "No track with ID '" << id << "'. \n"
23 << "Add a track with ID '" << id << "' before before adding keyframes.";
24 return ss.str();
25 }
26
30
31 std::string
33 {
34 std::stringstream ss;
35 ss << "Track with ID '" << id
36 << "' is empty. \n"
37 "Add a keyframe to track '"
38 << id << "' before updating.";
39 return ss.str();
40 }
41
42 static std::string
43 makeMsg(const TrackID& id, int typeIndex, int expectedTypeIndex)
44 {
45 std::stringstream ss;
46 ss << "Tried to add keyframe with value type '" << typeIndex << "' to non-empty track '"
47 << id << "' containing values of type '" << expectedTypeIndex << "'. \n"
48 << "Only one value type per track is allowed.";
49 return ss.str();
50 }
51
53 int typeIndex,
54 int expectedTypeIndex) :
55 TrajectoryException(makeMsg(trackID, typeIndex, expectedTypeIndex))
56 {
57 }
58
59
60} // namespace armarx::trajectory::error
std::string TrackID
ID of tracks.
static std::string makeMsg(const TrackID &id)
static std::string makeMsg(const TrackID &id)
WrongValueTypeInKeyframe(const TrackID &trackID, int typeIndex, int expectedTypeIndex)