mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Handle early exception from AsynchronousFileChannel#write
Closes gh-36184
This commit is contained in:
@@ -1205,7 +1205,13 @@ public abstract class DataBufferUtils {
|
||||
long pos = this.position.get();
|
||||
Attachment attachment = new Attachment(byteBuffer, dataBuffer, iterator);
|
||||
this.writing.set(true);
|
||||
this.channel.write(byteBuffer, pos, attachment, this);
|
||||
try {
|
||||
this.channel.write(byteBuffer, pos, attachment, this);
|
||||
}
|
||||
catch (RuntimeException ex) {
|
||||
// If the exception escapes, route it to the failure handler
|
||||
failed(ex, attachment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user