Skip to content

Commit

Permalink
repl: do not crash when tab-completing import errors
Browse files Browse the repository at this point in the history
File not found while importing is not currently caught by the tab-completion handler.

Original bug report: https://git.lix.systems/lix-project/lix/issues/340
Fix has been adapted from https://gerrit.lix.systems/c/lix/+/1189
  • Loading branch information
Pierre Bourdon authored and Mic92 committed May 25, 2024
1 parent f97da4b commit c645fad
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libcmd/repl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ StringSet NixRepl::completePrefix(const std::string & prefix)
// Quietly ignore evaluation errors.
} catch (BadURL & e) {
// Quietly ignore BadURL flake-related errors.
} catch (FileNotFound & e) {
// Quietly ignore non-existent file beeing `import`-ed.
}
}

Expand Down

0 comments on commit c645fad

Please sign in to comment.