aboutsummaryrefslogtreecommitdiff
path: root/src/ui/window_class.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-21 22:44:31 +0800
committercrupest <crupest@outlook.com>2019-03-21 22:44:31 +0800
commitafdac77a66143375b5bebd4ff128b0fba87c5d21 (patch)
tree8c003a2d32e9411e55544114a3c2c14128909910 /src/ui/window_class.cpp
parentb514247f79469c15959b00ca3276879033f932ff (diff)
downloadcru-afdac77a66143375b5bebd4ff128b0fba87c5d21.tar.gz
cru-afdac77a66143375b5bebd4ff128b0fba87c5d21.tar.bz2
cru-afdac77a66143375b5bebd4ff128b0fba87c5d21.zip
Change all error handling.
Diffstat (limited to 'src/ui/window_class.cpp')
-rw-r--r--src/ui/window_class.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ui/window_class.cpp b/src/ui/window_class.cpp
index 456d9492..5e8b3454 100644
--- a/src/ui/window_class.cpp
+++ b/src/ui/window_class.cpp
@@ -1,5 +1,7 @@
#include "window_class.hpp"
+#include "exception.hpp"
+
namespace cru::ui {
WindowClass::WindowClass(const String& name, WNDPROC window_proc,
HINSTANCE h_instance)
@@ -20,6 +22,7 @@ WindowClass::WindowClass(const String& name, WNDPROC window_proc,
window_class.hIconSm = NULL;
atom_ = ::RegisterClassExW(&window_class);
- if (atom_ == 0) throw std::runtime_error("Failed to create window class.");
+ if (atom_ == 0)
+ throw Win32Error(::GetLastError(), "Failed to create window class.");
}
} // namespace cru::ui