From 3303708e94b20aa7cec206aa61e85a504e1b4444 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 14 May 2014 07:05:09 -0700 Subject: [PATCH] Document ThrowSystemError and ThrowWinError. --- doc/index.rst | 7 +++++++ format.h | 16 ++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/doc/index.rst b/doc/index.rst index 0f631ce1..4e6c6211 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -50,6 +50,13 @@ Write API .. _formatstrings: +System Error Reporting +---------------------- + +.. doxygenfunction:: fmt::ThrowSystemError + +.. doxygenfunction:: fmt::ThrowWinError + Format String Syntax -------------------- diff --git a/format.h b/format.h index 27c70051..abfa94e7 100644 --- a/format.h +++ b/format.h @@ -1590,9 +1590,9 @@ class SystemErrorSink { /** \rst Formats a message and throws SystemError with the description of the form - ": ", 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. + ": ", 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``. \endrst */ inline Formatter ThrowSystemError( @@ -1622,10 +1622,14 @@ class WinErrorSink { }; /** + \rst Formats a message and throws SystemError with the description of the form - ": ", 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. + ": ", 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``. + + This function is only available on Windows. + \endrst */ inline Formatter ThrowWinError(int error_code, StringRef format) { Formatter f(format, WinErrorSink(error_code));