mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Add CommandException to abstract cli return codes for errors
This commit is contained in:
parent
c6395b9f35
commit
221d937eec
47 changed files with 538 additions and 572 deletions
|
@ -19,12 +19,16 @@ public final class PlainTextWriterImpl implements PlainTextWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void println(String format, Object... args) throws IOException {
|
||||
public void println(String format, Object... args) {
|
||||
final var message = MessageFormatter.arrayFormat(format, args).getMessage();
|
||||
|
||||
writer.write(message);
|
||||
writer.write(System.lineSeparator());
|
||||
writer.flush();
|
||||
try {
|
||||
writer.write(message);
|
||||
writer.write(System.lineSeparator());
|
||||
writer.flush();
|
||||
} catch (IOException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -51,8 +55,12 @@ public final class PlainTextWriterImpl implements PlainTextWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void println(final String format, final Object... args) throws IOException {
|
||||
writer.write(spaces);
|
||||
public void println(final String format, final Object... args) {
|
||||
try {
|
||||
writer.write(spaces);
|
||||
} catch (IOException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
plainTextWriter.println(format, args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue