mirror of
https://github.com/NixOS/nix
synced 2025-06-30 03:23:16 +02:00
Improve 'coroutine has finished' error message
This commit is contained in:
parent
6317c65937
commit
ebe3d2d370
3 changed files with 16 additions and 7 deletions
|
@ -214,7 +214,11 @@ struct LambdaSource : Source
|
|||
|
||||
/* Convert a function that feeds data into a Sink into a Source. The
|
||||
Source executes the function as a coroutine. */
|
||||
std::unique_ptr<Source> sinkToSource(std::function<void(Sink &)> fun);
|
||||
std::unique_ptr<Source> sinkToSource(
|
||||
std::function<void(Sink &)> fun,
|
||||
std::function<void()> eof = []() {
|
||||
throw EndOfFile("coroutine has finished");
|
||||
});
|
||||
|
||||
|
||||
void writePadding(size_t len, Sink & sink);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue