diff options
author | crupest <crupest@outlook.com> | 2019-03-21 22:44:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-21 22:44:31 +0800 |
commit | afdac77a66143375b5bebd4ff128b0fba87c5d21 (patch) | |
tree | 8c003a2d32e9411e55544114a3c2c14128909910 /src/ui/window_class.cpp | |
parent | b514247f79469c15959b00ca3276879033f932ff (diff) | |
download | cru-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.cpp | 5 |
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 |