12#ifndef CCSDS124_ERROR_HPP
13#define CCSDS124_ERROR_HPP
17#if !CCSDS124_NO_EXCEPTIONS
47 return "Invalid argument";
49 return "Buffer overflow";
51 return "Buffer underflow";
53 return "Invalid or corrupted data";
55 return "Unknown error";
59#if !CCSDS124_NO_EXCEPTIONS
67 : std::runtime_error(message), error_code_(
code) {}
Base exception for CCSDS 124.0-B-1 errors.
Ccsds124Exception(const std::string &message, Error code=Error::InvalidArg)
Error code() const noexcept
Exception for invalid arguments.
InvalidArgumentException(const std::string &message)
Exception for invalid/corrupted data.
InvalidDataException(const std::string &message)
Exception for buffer overflow.
OverflowException(const std::string &message)
Exception for buffer underflow.
UnderflowException(const std::string &message)
CCSDS 124.0-B-1 compile-time configuration.
const char * error_string(Error error) noexcept
Get error message for error code.
Error
Error codes for error-code-based error handling.
@ Underflow
Buffer underflow (not enough data)
@ Overflow
Buffer overflow.
@ InvalidData
Invalid/corrupted data.
@ InvalidArg
Invalid argument.