aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/error.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/error.hpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/error.hpp b/src/error.hpp
index 04ec8c9..8a0778c 100644
--- a/src/error.hpp
+++ b/src/error.hpp
@@ -12,26 +12,23 @@
typedef std::system_error Error;
-namespace error
-{
- inline Error make(const char* function_name)
- {
- const auto ec = GetLastError();
- return {static_cast<int>(ec), std::system_category(), function_name};
- }
+namespace error {
- inline void raise(const char* function_name)
- {
- throw make(function_name);
- }
+inline Error make(const char* function_name) {
+ const auto ec = GetLastError();
+ return {static_cast<int>(ec), std::system_category(), function_name};
+}
- inline void report(const std::exception& e)
- {
- MessageBoxA(NULL, e.what(), NULL, MB_OK);
- }
+inline void raise(const char* function_name) {
+ throw make(function_name);
+}
- inline int get_code(const Error& e)
- {
- return e.code().value();
- }
+inline void report(const std::exception& e) {
+ MessageBoxA(NULL, e.what(), NULL, MB_OK);
}
+
+inline int get_code(const Error& e) {
+ return e.code().value();
+}
+
+} // namespace error