style: !is_release instead of is_debug

This commit is contained in:
Tomáš Mládek 2023-03-19 20:05:10 +01:00
parent b4ed93e576
commit 5b0f59abab

View file

@ -30,7 +30,7 @@ use diesel::r2d2::{self, ConnectionManager};
use diesel::result::{DatabaseErrorKind, Error}; use diesel::result::{DatabaseErrorKind, Error};
use diesel::sqlite::SqliteConnection; use diesel::sqlite::SqliteConnection;
use hierarchies::initialize_hier; use hierarchies::initialize_hier;
use shadow_rs::is_debug; use shadow_rs::is_release;
use std::convert::TryFrom; use std::convert::TryFrom;
use std::fs; use std::fs;
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@ -84,7 +84,7 @@ pub struct LoggingHandler {
impl diesel::r2d2::HandleError<diesel::r2d2::Error> for LoggingHandler { impl diesel::r2d2::HandleError<diesel::r2d2::Error> for LoggingHandler {
fn handle_error(&self, error: diesel::r2d2::Error) { fn handle_error(&self, error: diesel::r2d2::Error) {
error!(name = self.name, "Database error: {}", error); error!(name = self.name, "Database error: {}", error);
if is_debug() { if !is_release() {
panic!("Database error! This should not happen! {}", error); panic!("Database error! This should not happen! {}", error);
} }
} }