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

Console-ui example: catch UserInterruptException in place of IOError #1164

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2024, the original author(s).
* Copyright (c) 2024-2025, the original author(s).
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
Expand All @@ -8,7 +8,6 @@
*/
package org.jline.consoleui.examples;

import java.io.IOError;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
Expand All @@ -21,6 +20,7 @@
import org.jline.consoleui.prompt.builder.PromptBuilder;
import org.jline.reader.LineReader;
import org.jline.reader.LineReaderBuilder;
import org.jline.reader.UserInterruptException;
import org.jline.reader.impl.completer.StringsCompleter;
import org.jline.terminal.Terminal;
import org.jline.terminal.TerminalBuilder;
Expand Down Expand Up @@ -109,7 +109,7 @@ public static void main(String[] args) {
System.out.println("We will deliver the order in 5 minutes");
}
}
} catch (IOError e) {
} catch (UserInterruptException e) {
System.out.println("<ctrl>-c pressed");
} catch (Exception e) {
System.out.println(e.getMessage());
Expand Down
Loading