mirror of
https://github.com/fmtlib/fmt.git
synced 2024-11-08 11:33:46 +00:00
Document what happens if you pass an invalid error code
to SystemError or WindowsError
This commit is contained in:
parent
502d2ede8a
commit
326ade7698
8
format.h
8
format.h
@ -1427,6 +1427,8 @@ class SystemError : public internal::RuntimeError {
|
|||||||
where *<message>* is the formatted message and *<system-message>* is
|
where *<message>* is the formatted message and *<system-message>* is
|
||||||
the system message corresponding to the error code.
|
the system message corresponding to the error code.
|
||||||
*error_code* is a system error code as given by ``errno``.
|
*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**::
|
**Example**::
|
||||||
|
|
||||||
@ -2109,9 +2111,7 @@ void report_system_error(int error_code, StringRef message) FMT_NOEXCEPT(true);
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
|
|
||||||
/**
|
/** A Windows error. */
|
||||||
A Windows error.
|
|
||||||
*/
|
|
||||||
class WindowsError : public SystemError {
|
class WindowsError : public SystemError {
|
||||||
private:
|
private:
|
||||||
void init(int error_code, StringRef format_str, ArgList args);
|
void init(int error_code, StringRef format_str, ArgList args);
|
||||||
@ -2127,6 +2127,8 @@ class WindowsError : public SystemError {
|
|||||||
where *<message>* is the formatted message and *<system-message>* is the system
|
where *<message>* is the formatted message and *<system-message>* is the system
|
||||||
message corresponding to the error code.
|
message corresponding to the error code.
|
||||||
*error_code* is a Windows error code as given by ``GetLastError``.
|
*error_code* is a Windows error code as given by ``GetLastError``.
|
||||||
|
If *error_code* is not a valid error code such as -1, the system message
|
||||||
|
will look like "error -1".
|
||||||
|
|
||||||
**Example**::
|
**Example**::
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user