Skip to content

Commit

Permalink
Ignore SendErrors when handling grammars (#2641)
Browse files Browse the repository at this point in the history
When handling grammars, fetching and building is done in a thread
pool.  Results are communicated over channels and the receiving
channel is closed on first error. This causes subsequent sends to
fail causing a mess in stderr. This ignores all SendErrors causing
only the first error to be printed.
  • Loading branch information
Frojdholm authored Jun 2, 2022
1 parent 378f438 commit f7c27b6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion helix-loader/src/grammar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ where
let tx = tx.clone();

pool.execute(move || {
tx.send(job(grammar)).unwrap();
// Ignore any SendErrors, if any job in another thread has encountered an
// error the Receiver will be closed causing this send to fail.
let _ = tx.send(job(grammar));
});
}

Expand Down

0 comments on commit f7c27b6

Please sign in to comment.