Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add exception inheritance for CppSQLite3Exception, harder try catch re-throw in exception handler #1544

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions dCommon/Diagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ void CatchUnhandled(int sig) {
if (eptr) std::rethrow_exception(eptr);
} catch(const std::exception& e) {
LOG("Caught exception: '%s'", e.what());
} catch (...) {
LOG("Caught unknown exception.");
}

#ifndef INCLUDE_BACKTRACE
Expand Down
5 changes: 4 additions & 1 deletion thirdparty/SQLite/CppSQLite3.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
#include "sqlite3.h"
#include <cstdio>
#include <cstring>
#include <exception>

#define CPPSQLITE_ERROR 1000

class CppSQLite3Exception
class CppSQLite3Exception : public std::exception
{
public:

Expand All @@ -54,6 +55,8 @@ class CppSQLite3Exception
const int errorCode() { return mnErrCode; }

const char* errorMessage() { return mpszErrMess; }

const char* what() const noexcept override { return mpszErrMess; }

static const char* errorCodeAsString(int nErrCode);

Expand Down
Loading