SatNOGS-COMMS  4.1.0
A COMMS subsystem for CubeSats
Loading...
Searching...
No Matches
satnogs::comms::lib::exception Class Reference

Exception base class. More...

#include <exception.hpp>

Inheritance diagram for satnogs::comms::lib::exception:
satnogs::comms::adc_initialization_exception satnogs::comms::can_enable_exception satnogs::comms::device_not_configured_exception satnogs::comms::device_not_ready_exception satnogs::comms::flash_init_exception satnogs::comms::flash_read_exception satnogs::comms::i2c_bsp_exception satnogs::comms::isotp_bind_exception satnogs::comms::isotp_recv_exception satnogs::comms::lib::emc1702_incorrect_sensor_info satnogs::comms::lib::emc1702_inval satnogs::comms::lib::emc1702_not_ready satnogs::comms::lib::emc1702_thermal_shutdown_needed satnogs::comms::lib::fpf270x_pin_not_configured_exception satnogs::comms::lib::initialization_exception satnogs::comms::lib::inval_arg_exception satnogs::comms::lib::invalid_sensor_exception satnogs::comms::lib::mixer_lock_exception satnogs::comms::lib::msg_too_long_exception satnogs::comms::lib::pll_ls_exception satnogs::comms::lib::radio_exception satnogs::comms::lib::resource_unavailable_exception satnogs::comms::lib::rf_frontend24_exception satnogs::comms::lib::timeout_exception satnogs::comms::lib::uninitialization_exception satnogs::comms::lib::unsupported_freq_exception satnogs::comms::ota::inval_session satnogs::comms::spi_bsp_exception satnogs::comms::storage::delete_dir_exception satnogs::comms::storage::delete_file_exception satnogs::comms::storage::fs_exception satnogs::comms::storage::max_path_exception satnogs::comms::storage::mount_exception satnogs::comms::storage::not_ready_exception satnogs::comms::storage::open_dir_exception satnogs::comms::storage::read_exception satnogs::comms::time::to_string_exception satnogs::comms::utils::iface_ctrl::disabled_exception satnogs::comms::utils::iface_ctrl::tx_inhibit_exception satnogs::comms::v_bat_exception satnogs::comms::watchdog_exception

Classes

class  error_msg
 A class representing error messages in the SatNOGS-COMMS system. More...

Public Types

enum class  severity : uint8_t {
  CATASTROPHIC = 0 , CRITICAL = 1 , MAJOR = 2 , MINOR = 3 ,
  NONE = 4
}
 Severity levels of exceptions. More...

Public Member Functions

 exception (severity sev, const char *file, int lineno, const error_msg &err_msg)
 Constructor for the exception class.
void to_string (etl::string_stream &stream) const
 Creates a string representation of the exception.
void to_string (etl::istring &s) const
 Creates a string representation of the exception.
const char * what () const noexcept override
int32_t get_errno () const
severity get_severity () const
 Get error severity level as defined in FDIR.

Detailed Description

Exception base class.

Each exception of SatNOGS-COMMS control library has a severity level that allows the firmware to take actions based on the severity. In addition the class provides the filename as well as the code line from which the exception was thrown. Also two different messages are supported. A verbose one that can be used during development and terse,, concise one that can be used for logging during in-flight.

Each exception is categorized by a severity level, enabling the firmware to take appropriate actions based on the severity of the issue. Key Features of the exceptions system:

  • Severity Levels: Differentiates exceptions based on their impact on system operation.
  • Filename and Line Number: Provides precise information about the origin of the exception.
  • Verbose and Terse Messages: Offers detailed explanations for development purposes and concise logs for in-flight operations.
Warning
etl::exception does not derive from the std::exception. Therefore any attempts to handle globally an exception will fail. The lib::exception class however, derives from both etl::exception and std::exception.
Note
Exception handling is a task of the firmware/user

Definition at line 62 of file exception.hpp.

Member Enumeration Documentation

◆ severity

enum class satnogs::comms::lib::exception::severity : uint8_t
strong

Severity levels of exceptions.

See also
FDIR analysis at https://cloud.libre.space/s/xzskpy8m3Nb54YL
Enumerator
CATASTROPHIC 

Failure causing loss of mission.

CRITICAL 

Failure causing mission degradation or significant damage.

MAJOR 

Failure causing minor mission degradation.

MINOR 

Failure having minimal impact.

NONE 

No failure.

Definition at line 70 of file exception.hpp.

Constructor & Destructor Documentation

◆ exception()

satnogs::comms::lib::exception::exception ( severity sev,
const char * file,
int lineno,
const error_msg & err_msg )
inline

Constructor for the exception class.

Parameters
sevThe severity level of the error as defined in FDIR
fileThe file where the exception was thrown.
linenoThe line number where the exception was thrown.
err_msgThe error message object containing the error details.

Definition at line 102 of file exception.hpp.

Member Function Documentation

◆ get_errno()

int32_t satnogs::comms::lib::exception::get_errno ( ) const
inline

Definition at line 152 of file exception.hpp.

◆ get_severity()

severity satnogs::comms::lib::exception::get_severity ( ) const
inline

Get error severity level as defined in FDIR.

The severity levels are defined in exception::severity enum class.

Returns
exception::severity the severity level of the error.

Definition at line 165 of file exception.hpp.

◆ to_string() [1/2]

void satnogs::comms::lib::exception::to_string ( etl::istring & s) const
inline

Creates a string representation of the exception.

Parameters
sa reference to an ETL string where the exception message will be stored.
Note
This method appends the exception message to the provided ETL string

Definition at line 139 of file exception.hpp.

◆ to_string() [2/2]

void satnogs::comms::lib::exception::to_string ( etl::string_stream & stream) const
inline

Creates a string representation of the exception.

Parameters
streama reference to an ETL string stream where the exception message will be stored.
Note
This method appends the exception message to the provided ETL string stream.

Definition at line 122 of file exception.hpp.

◆ what()

const char * satnogs::comms::lib::exception::what ( ) const
inlineoverridenoexcept

Definition at line 146 of file exception.hpp.


The documentation for this class was generated from the following file: