From 9b2519524918d6222653eed2f6fea58d6cd43eff Mon Sep 17 00:00:00 2001 From: simonedegiacomi Date: Wed, 14 Aug 2019 11:40:42 +0200 Subject: [PATCH] exit with 1 when program fails --- src/main/java/it/simonedegiacomi/files2uf2/Main.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/it/simonedegiacomi/files2uf2/Main.java b/src/main/java/it/simonedegiacomi/files2uf2/Main.java index 07ede8f..be1ebcd 100644 --- a/src/main/java/it/simonedegiacomi/files2uf2/Main.java +++ b/src/main/java/it/simonedegiacomi/files2uf2/Main.java @@ -30,8 +30,8 @@ private static void packFiles() throws IOException { UF2BlocksUtils.packFilesToUF2(sourceFiles, destinationFile); System.out.println("UF2 file successfully created"); } catch ( Exception e ) { - System.out.println("error while creating the uf2 file:" + e.getMessage()); - e.printStackTrace(); + System.out.println("error while creating the uf2 file: " + e.getMessage()); + System.exit(1); } } @@ -40,8 +40,8 @@ private static void unpackFiles() throws IOException { UF2BlocksUtils.unpackUF2ToFolder(uf2SourceFile, destinationFile); System.out.println("UF2 file successfully extracted"); } catch ( Exception e ) { - System.out.println("error while unpacking the uf2 file:" + e.getMessage()); - e.printStackTrace(); + System.out.println("error while unpacking the uf2 file: " + e.getMessage()); + System.exit(1); } }