Skip to content

Commit

Permalink
Pass an error to onComplete in all cases, even on broken pipes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tobias committed Feb 6, 2015
1 parent 1158fca commit cccf579
Showing 1 changed file with 3 additions and 10 deletions.
Expand Up @@ -137,18 +137,11 @@ protected void doSend(final byte[] data,
sendStarted = true;
}

try {
this.stream.write(data);
if (!shouldClose) {
this.stream.flush();
}
} catch (IOException e) {
// TODO: should we only deal with "Broken pipe" IOE's here? rethrow others?
this.closer.run();
}

this.stream.write(data);
if (shouldClose) {
this.closer.run();
} else {
this.stream.flush();
}
} catch (Throwable e) {
this.closer.run();
Expand Down

0 comments on commit cccf579

Please sign in to comment.