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

feat: remove panics from applications #5943

Merged
merged 1 commit into from
Nov 10, 2023
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
10 changes: 1 addition & 9 deletions applications/minotari_console_wallet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

use std::{panic, process};
use std::process;

use clap::Parser;
use log::*;
Expand All @@ -47,14 +47,6 @@ mod utils;
mod wallet_modes;

fn main() {
// Setup a panic hook which prints the default rust panic message but also exits the process. This makes a panic in
// any thread "crash" the system instead of silently continuing.
let default_hook = panic::take_hook();
panic::set_hook(Box::new(move |info| {
default_hook(info);
process::exit(1);
}));

match main_inner() {
Ok(_) => process::exit(0),
Err(err) => {
Expand Down
10 changes: 1 addition & 9 deletions applications/minotari_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
/// `whoami` - Displays identity information about this Base Node and it's wallet
/// `quit` - Exits the Base Node
/// `exit` - Same as quit
use std::{panic, process, sync::Arc};
use std::{process, sync::Arc};

use clap::Parser;
use log::*;
Expand All @@ -85,14 +85,6 @@ const LOG_TARGET: &str = "minotari::base_node::app";

/// Application entry point
fn main() {
// Setup a panic hook which prints the default rust panic message but also exits the process. This makes a panic in
// any thread "crash" the system instead of silently continuing.
let default_hook = panic::take_hook();
panic::set_hook(Box::new(move |info| {
default_hook(info);
process::exit(1);
}));

if let Err(err) = main_inner() {
eprintln!("{:?}", err);
let exit_code = err.exit_code;
Expand Down
Loading