aboutsummaryrefslogtreecommitdiff
path: root/butl
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-03-21 13:29:30 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-03-21 13:30:36 +0200
commit5a2fba169fc1bc3587d7d9b351d5c46a74f8f7b8 (patch)
tree93675a08158d451bc8859cd6027ab8f34da2655f /butl
parentaa5ce03b40003ee8f7cfff4d2f1285b405f5906a (diff)
Add prototypes for throw_generic_error() and throw_system_error()
Diffstat (limited to 'butl')
-rw-r--r--butl/utility16
1 files changed, 16 insertions, 0 deletions
diff --git a/butl/utility b/butl/utility
index 208a840..7dc4d73 100644
--- a/butl/utility
+++ b/butl/utility
@@ -20,6 +20,22 @@
namespace butl
{
+ // Throw std::system_error with generic_category or system_category,
+ // respectively.
+ //
+ // The generic version should be used for portable errno codes (those that
+ // are mapped to std::errc). The system version should be used for platform-
+ // specific codes, for example, additional errno codes on POSIX systems or
+ // the result of GetLastError() on Windows.
+ //
+ // See also the exception sanitization below.
+ //
+ [[noreturn]] void
+ throw_generic_error (int errno_code);
+
+ [[noreturn]] void
+ throw_system_error (int system_code, int fallback_errno_code = 0);
+
// Convert ASCII character/string case. If there is no upper/lower case
// counterpart, leave the character unchanged. The POSIX locale (also known
// as C locale) must be the current application locale. Otherwise the