Program Listing for File exception.h

Return to documentation for file (include/franka/exception.h)

// Copyright (c) 2023 Franka Robotics GmbH
// Use of this source code is governed by the Apache-2.0 license, see LICENSE
#pragma once

#include <stdexcept>
#include <string>

#include <franka/logging/robot_state_log.hpp>

namespace franka {

struct Exception : public std::runtime_error {
  using std::runtime_error::runtime_error;
};

struct ModelException : public Exception {
  using Exception::Exception;
};

struct NetworkException : public Exception {
  using Exception::Exception;
};

struct ProtocolException : public Exception {
  using Exception::Exception;
};

struct IncompatibleVersionException : public Exception {
  IncompatibleVersionException(uint16_t server_version, uint16_t library_version) noexcept;

  const uint16_t server_version;
  const uint16_t library_version;
};

struct ControlException : public Exception {
  explicit ControlException(const std::string& what, std::vector<franka::Record> log = {}) noexcept;

  const std::vector<franka::Record> log;
};

struct CommandException : public Exception {
  using Exception::Exception;
};

struct RealtimeException : public Exception {
  using Exception::Exception;
};

struct InvalidOperationException : public Exception {
  using Exception::Exception;
};

}  // namespace franka