From afdac77a66143375b5bebd4ff128b0fba87c5d21 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 21 Mar 2019 22:44:31 +0800 Subject: Change all error handling. --- src/ui/window_class.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ui/window_class.cpp') 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 -- cgit v1.2.3