Skip to content

Commit

Permalink
Log exceptions caught during completion, fixes #115
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Apr 24, 2017
1 parent d52c65b commit aa22442
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -3716,19 +3716,28 @@ protected boolean doComplete(CompletionType lst, boolean useMenu, boolean prefix
if (expandHistory()) {
return true;
}
} catch (IllegalArgumentException e) {
} catch (Exception e) {
Log.info("Error while expanding history", e);
return false;
}

// Parse the command line and find completion candidates
List<Candidate> candidates = new ArrayList<>();
// Parse the command line
ParsedLine line;
try {
line = parser.parse(buf.toString(), buf.cursor(), ParseContext.COMPLETE);
} catch (Exception e) {
Log.info("Error while parsing line", e);
return false;
}

// Find completion candidates
List<Candidate> candidates = new ArrayList<>();
try {
if (completer != null) {
completer.complete(this, line, candidates);
}
} catch (Exception e) {
Log.info("Error while finding completion candidates", e);
return false;
}

Expand Down

1 comment on commit aa22442

@jdillon
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

Please sign in to comment.