diff --git a/conanfile.py b/conanfile.py index 6221b6c38a..1d51628fa3 100644 --- a/conanfile.py +++ b/conanfile.py @@ -98,6 +98,7 @@ def requirements(self): self.requires("protobuf/3.21.9") self.requires("zlib/1.2.12") self.requires("openssl/1.1.1l") + self.requires("sentry-native/0.6.5") def generate(self): deps = CMakeDeps(self) diff --git a/src/main.cpp b/src/main.cpp index bcfd39d9f0..e568d0e248 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,7 +8,7 @@ #endif #include - +#include #include "Application.h" namespace cura @@ -37,7 +37,21 @@ int main(int argc, char** argv) #endif std::cerr << std::boolalpha; + // Setup sentry error handling. + sentry_options_t *options = sentry_options_new(); + // TODO: Right now we just hardcode the key. We should probably get that from some kind of secret for release builds + sentry_options_set_dsn(options, "https://734f9ec9024f73e53701d59c3ffddfe3@o323038.ingest.sentry.io/4506257745510401"); + // This is also the default-path. For further information and recommendations: + // https://docs.sentry.io/platforms/native/configuration/options/#database-path + sentry_options_set_database_path(options, ".sentry-native"); + // TODO: Hardcoded the version number, we should also get that from somewhere. Can't be bothered to figure that out now + sentry_options_set_release(options, "curaengine@1.0.0"); + sentry_options_set_debug(options, 1); + sentry_init(options); + cura::Application::getInstance().run(argc, argv); + sentry_close(); + return 0; }