diff options
author | Jack Lloyd <[email protected]> | 2018-11-17 16:23:51 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2018-11-23 11:15:25 -0500 |
commit | b909778857b3e0b7eb86ac26c818e5f25baaddbd (patch) | |
tree | f8a5c9cbec26310bbfc9077563892b04db158a48 /src/lib/tls/sessions_sql | |
parent | c20a428ca2f7c1ef96e642f55bb898010444c499 (diff) |
Make exceptions easier to translate to error codes
Avoid throwing base Botan::Exception type, as it is difficult to
determine what the error is in that case.
Add Exception::error_code and Exception::error_type which allows
(for error code) more information about the error and (for error type)
allows knowing the error type without requiring a sequence of catches.
See GH #1742
Diffstat (limited to 'src/lib/tls/sessions_sql')
-rw-r--r-- | src/lib/tls/sessions_sql/tls_session_manager_sql.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp b/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp index 45b3059f5..1959db266 100644 --- a/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp +++ b/src/lib/tls/sessions_sql/tls_session_manager_sql.cpp @@ -69,14 +69,14 @@ Session_Manager_SQL::Session_Manager_SQL(std::shared_ptr<SQL_Database> db, m_session_key.assign(x.begin() + 2, x.end()); if(check_val_created != check_val_db) - throw Exception("Session database password not valid"); + throw Invalid_Argument("Session database password not valid"); } } else { // maybe just zap the salts + sessions tables in this case? if(salts != 0) - throw Exception("Seemingly corrupted database, multiple salts found"); + throw Internal_Error("Seemingly corrupted TLS session db, multiple salts found"); // new database case |