aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-12-20 17:03:08 -0500
committerJack Lloyd <[email protected]>2015-12-20 17:03:08 -0500
commit66fb50a462d72c106bd4a4102a1faff92bd5f7e2 (patch)
tree4ee9fa1680108e34b8cf7d4ea08bf794ae89881f /src/lib/base
parent8ce0a52ba72837b3e3e8aee63f7ce3a96ca07178 (diff)
Throw Lookup_Error instead of bare Exception when creating an obj fails
in the algo factory. Fixes remaining issues of GH #369 - test_pubkey.cpp was expecting Lookup_Error when something isn't found.
Diffstat (limited to 'src/lib/base')
-rw-r--r--src/lib/base/algo_registry.h48
1 files changed, 24 insertions, 24 deletions
diff --git a/src/lib/base/algo_registry.h b/src/lib/base/algo_registry.h
index 3b1a72d88..a431e9178 100644
--- a/src/lib/base/algo_registry.h
+++ b/src/lib/base/algo_registry.h
@@ -22,7 +22,7 @@
#define BOTAN_WORKAROUND_GH_321
#define NOMINMAX 1
#define WIN32_LEAN_AND_MEAN 1
- #include <Windows.h>
+ #include <windows.h>
#endif
@@ -33,28 +33,28 @@ namespace Botan {
class WinCS_Mutex
{
public:
- WinCS_Mutex()
- {
- InitializeCriticalSection(&m_cs);
- }
-
- ~WinCS_Mutex()
- {
- DeleteCriticalSection(&m_cs);
- }
-
- void lock()
- {
- EnterCriticalSection(&m_cs);
- }
-
- void unlock()
- {
- LeaveCriticalSection(&m_cs);
- }
-
- private:
- CRITICAL_SECTION m_cs;
+ WinCS_Mutex()
+ {
+ ::InitializeCriticalSection(&m_cs);
+ }
+
+ ~WinCS_Mutex()
+ {
+ ::DeleteCriticalSection(&m_cs);
+ }
+
+ void lock()
+ {
+ ::EnterCriticalSection(&m_cs);
+ }
+
+ void unlock()
+ {
+ ::LeaveCriticalSection(&m_cs);
+ }
+
+ private:
+ CRITICAL_SECTION m_cs;
};
#endif
@@ -111,7 +111,7 @@ class Algo_Registry
}
catch(std::exception& e)
{
- throw Exception("Creating '" + spec.as_string() + "' failed: " + e.what());
+ throw Lookup_Error("Creating '" + spec.as_string() + "' failed: " + e.what());
}
return nullptr;