Commit 3303708e authored by Victor Zverovich's avatar Victor Zverovich

Document ThrowSystemError and ThrowWinError.

parent a59dc937
......@@ -50,6 +50,13 @@ Write API
.. _formatstrings:
System Error Reporting
----------------------
.. doxygenfunction:: fmt::ThrowSystemError
.. doxygenfunction:: fmt::ThrowWinError
Format String Syntax
--------------------
......
......@@ -1590,9 +1590,9 @@ class SystemErrorSink {
/**
\rst
Formats a message and throws SystemError with the description of the form
"<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.
"<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``.
\endrst
*/
inline Formatter<SystemErrorSink> ThrowSystemError(
......@@ -1622,10 +1622,14 @@ class WinErrorSink {
};
/**
\rst
Formats a message and throws SystemError with the description of the form
"<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 Windows error code as given by GetLastError.
"<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 Windows error code as given by ``GetLastError``.
This function is only available on Windows.
\endrst
*/
inline Formatter<WinErrorSink> ThrowWinError(int error_code, StringRef format) {
Formatter<WinErrorSink> f(format, WinErrorSink(error_code));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment