From 326ade7698d8fce18034f346b5e04bb52cd9590c Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 7 Feb 2015 09:46:42 -0800 Subject: [PATCH] Document what happens if you pass an invalid error code to SystemError or WindowsError --- format.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/format.h b/format.h index b6d7d952..0af01439 100644 --- a/format.h +++ b/format.h @@ -1427,6 +1427,8 @@ class SystemError : public internal::RuntimeError { where ** is the formatted message and ** 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**:: @@ -2109,9 +2111,7 @@ void report_system_error(int error_code, StringRef message) FMT_NOEXCEPT(true); #ifdef _WIN32 -/** - A Windows error. -*/ +/** A Windows error. */ class WindowsError : public SystemError { private: void init(int error_code, StringRef format_str, ArgList args); @@ -2127,7 +2127,9 @@ class WindowsError : public SystemError { where ** is the formatted message and ** is the system message corresponding to the error code. *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**:: // This throws a WindowsError with the description