diff --git a/include/mio/mmap.hpp b/include/mio/mmap.hpp index 8e5d7c0..513eae8 100644 --- a/include/mio/mmap.hpp +++ b/include/mio/mmap.hpp @@ -112,7 +112,7 @@ public: { std::error_code error; map(path, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /** @@ -123,7 +123,7 @@ public: { std::error_code error; map(handle, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /** diff --git a/include/mio/shared_mmap.hpp b/include/mio/shared_mmap.hpp index 0ca5c14..b8f8799 100644 --- a/include/mio/shared_mmap.hpp +++ b/include/mio/shared_mmap.hpp @@ -96,7 +96,7 @@ public: { std::error_code error; map(path, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /** @@ -107,7 +107,7 @@ public: { std::error_code error; map(handle, offset, length, error); - if(error) { throw error; } + if(error) { throw std::system_error(error); } } /**