aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/142bot/bot.hpp2
-rw-r--r--include/142bot/modules.hpp7
2 files changed, 8 insertions, 1 deletions
diff --git a/include/142bot/bot.hpp b/include/142bot/bot.hpp
index a422416..165515f 100644
--- a/include/142bot/bot.hpp
+++ b/include/142bot/bot.hpp
@@ -9,12 +9,12 @@
class Module;
class ModuleLoader;
class Bot {
- pqxx::connection conn;
bool dev;
dpp::snowflake owner_id;
private:
bool run_database_migrations();
public:
+ pqxx::connection conn;
class dpp::cluster * core;
/* The bot's user from the ready event */
dpp::user user;
diff --git a/include/142bot/modules.hpp b/include/142bot/modules.hpp
index 3af0253..c0aad32 100644
--- a/include/142bot/modules.hpp
+++ b/include/142bot/modules.hpp
@@ -8,6 +8,7 @@
#pragma once
#include "bot.hpp"
+#include <sentry.h>
class ModuleLoader;
class Module;
@@ -77,10 +78,16 @@ enum Events
list_to_call = loader->EventHandlers[y]; \
break; \
} \
+ sentry_remove_tag("module"); \
} \
catch (std::exception& modexcept) \
{ \
core->log(dpp::ll_error, fmt::format("Exception caught in module: {}", modexcept.what())); \
+ sentry_value_t event = sentry_value_new_event(); \
+ sentry_value_t exc = sentry_value_new_exception("Exception", modexcept.what()); \
+ sentry_value_set_stacktrace(exc, NULL, 0); \
+ sentry_event_add_exception(event, exc); \
+ sentry_capture_event(event); \
} \
} \
};