From d33a0d567f5be01d0f0275fc71e5f13da58871fd Mon Sep 17 00:00:00 2001 From: mandreyel Date: Fri, 26 Oct 2018 09:00:27 +0200 Subject: [PATCH] Update docs to specify exception type --- README.md | 2 +- include/mio/mmap.hpp | 10 ++++++---- include/mio/shared_mmap.hpp | 10 ++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 901c8e1..b0abcf2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ NOTE: the file must exist before creating a mapping. There are three ways to map a file into memory: -- Using the constructor, which throws on failure: +- Using the constructor, which throws a `std::system_error` on failure: ```c++ mio::mmap_source mmap(path, offset, size_to_map); ``` diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index 513eae8..ed4af12 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -104,8 +104,9 @@ public: basic_mmap() = default; /** - * The same as invoking the `map` function, except any error that may occur while - * establishing the mapping is thrown. + * The same as invoking the `map` function, except any error that may occur + * while establishing the mapping is wrapped in a `std::system_error` and is + * thrown. */ template basic_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file) @@ -116,8 +117,9 @@ public: } /** - * The same as invoking the `map` function, except any error that may occur while - * establishing the mapping is thrown. + * The same as invoking the `map` function, except any error that may occur + * while establishing the mapping is wrapped in a `std::system_error` and is + * thrown. */ basic_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file) { diff --git a/include/mio/shared_mmap.hpp b/include/mio/shared_mmap.hpp index b8f8799..6ce187f 100644 --- a/include/mio/shared_mmap.hpp +++ b/include/mio/shared_mmap.hpp @@ -88,8 +88,9 @@ public: } /** - * The same as invoking the `map` function, except any error that may occur while - * establishing the mapping is thrown. + * The same as invoking the `map` function, except any error that may occur + * while establishing the mapping is wrapped in a `std::system_error` and is + * thrown. */ template basic_shared_mmap(const String& path, const size_type offset = 0, const size_type length = map_entire_file) @@ -100,8 +101,9 @@ public: } /** - * The same as invoking the `map` function, except any error that may occur while - * establishing the mapping is thrown. + * The same as invoking the `map` function, except any error that may occur + * while establishing the mapping is wrapped in a `std::system_error` and is + * thrown. */ basic_shared_mmap(const handle_type handle, const size_type offset = 0, const size_type length = map_entire_file) {