Only log panics in release builds.

This commit is contained in:
Nolan Darilek 2022-01-13 14:42:46 -06:00
parent 6a49deaefd
commit 10bf503c89

View File

@ -53,7 +53,9 @@ pub struct ErrorPlugin;
impl Plugin for ErrorPlugin { impl Plugin for ErrorPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
if !cfg!(debug_assertions) {
init_panic_handler(); init_panic_handler();
}
if let Some(config) = app.world.get_resource::<ErrorConfig>() { if let Some(config) = app.world.get_resource::<ErrorConfig>() {
if let Some(dsn) = &config.sentry_dsn { if let Some(dsn) = &config.sentry_dsn {
let guard = sentry::init(dsn.clone()); let guard = sentry::init(dsn.clone());