Skip to content

Commit 734fba1

Browse files
Improve error handling in AssocCommand
Refactor error handling in AssocCommand to throw IOExceptions.
1 parent 5500162 commit 734fba1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/main/java/com/mycmd/commands/AssocCommand.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,11 @@ public void execute(String[] args, ShellContext context) throws IOException {
8484
Thread.currentThread().interrupt();
8585
}
8686

87-
} catch (Exception e) {
88-
System.out.println("Error executing assoc: " + e.getMessage());
89-
}
90-
}
87+
} catch (IOException e) {
88+
throw e;
89+
} catch (Exception e) {
90+
throw new IOException("Error executing assoc", e);
91+
}
9192

9293
@Override
9394
public String description() {

0 commit comments

Comments
 (0)