# VectorNav C++ Library: include/vn/exceptions.h Source File

exceptions.h
Go to the documentation of this file.
#ifndef _VN_EXCEPTIONS_H_
#define _VN_EXCEPTIONS_H_
#include <stdexcept>
namespace vn {
class dimension_error : public std::runtime_error
{
public:
dimension_error() : runtime_error("dimension") { }
};
class unknown_error : public std::exception
{
public:
unknown_error() : exception() { }
};
class not_implemented : public std::logic_error
{
public:
not_implemented() : logic_error("Not implemented.") { }
explicit not_implemented(std::string msg) : logic_error(msg.c_str()) { }
};
class null_pointer : public std::exception
{
public:
null_pointer() : exception() { }
};
class invalid_operation : public std::runtime_error
{
public:
invalid_operation() : runtime_error("invalid operation") { }
explicit invalid_operation(std::string msg) : runtime_error(msg.c_str()) { }
};
class permission_denied : public std::runtime_error
{
public:
permission_denied() : runtime_error("permission denied") { }
#if VN_SUPPORTS_CSTR_STRING_CONCATENATE
explicit permission_denied(std::string itemName) : runtime_error(std::string("Permission denied for item '" + itemName + "'.").c_str()) { }
#else
explicit permission_denied(std::string itemName) : runtime_error("Permission denied for item.") { }
#endif
};
class not_supported : public std::exception
{
public:
not_supported() : exception() { }
};
class not_found : public std::runtime_error
{
public:
explicit not_found(std::string msg) : runtime_error(msg) { }
};
class invalid_format : public std::exception
{
public:
invalid_format() : exception() { }
};
class timeout : public std::exception
{
public:
timeout() : exception() { }
char const* what() const throw() { return "timeout"; }
};
}
#endif
vn::not_supported
Indicates the requested feature is not supported.
Definition: exceptions.h:64
vn::not_implemented
Indicates that the requested functionality is not currently implemented.
Definition: exceptions.h:29
vn::invalid_operation
Indicates an invalid operation was attempted.
Definition: exceptions.h:44
vn::not_found
Requested item not found.
Definition: exceptions.h:71
vn::permission_denied
Indicates invalid permission for the operation.
Definition: exceptions.h:52
vn::timeout
A timeout occurred.
Definition: exceptions.h:85
vn::unknown_error
Indicates an unknown error occurred.
Definition: exceptions.h:21
vn
Definition: attitude.h:8
vn::timeout::what
char const * what() const
Returns a description of the exception.
Definition: exceptions.h:93
vn::dimension_error
Exception class indicating that there as an dimensional error.
Definition: exceptions.h:14
vn::null_pointer
Indicates a null pointer was provided.
Definition: exceptions.h:37
vn::invalid_format
The format was invalid.
Definition: exceptions.h:78