Trading System API  3.0
Library for Simulating and Deploying Trading and Investment Strategies
fmt::SystemError Class Reference

#include <format.h>

Inherits fmt::internal::RuntimeError.

Public Member Functions

 SystemError (int error_code, CStringRef message)
 

Detailed Description

An error returned by an operating system or a language runtime, for example a file opening error.

Constructor & Destructor Documentation

fmt::SystemError::SystemError ( int  error_code,
CStringRef  message 
)
inline

Constructs a :class:fmt::SystemError object with the description of the form .. parsed-literal:: <message>*: *<system-message>* where *<message>* is the formatted message and *<system-message>* is the system message corresponding to the error code. error_code* is a system error code as given by errno. If error_code is not a valid error code such as -1, the system message may look like "Unknown error -1" and is platform-dependent.

Example**:: This throws a SystemError with the description cannot open file 'madeup': No such file or directory or similar (system message may vary). const char *filename = "madeup"; std::FILE *file = std::fopen(filename, "r"); if (!file) throw fmt::SystemError(errno, "cannot open file '{}'", filename);