summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mongo/db/sorter/sorter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/sorter/sorter.cpp b/src/mongo/db/sorter/sorter.cpp
index aa387dcb944..661b2effab0 100644
--- a/src/mongo/db/sorter/sorter.cpp
+++ b/src/mongo/db/sorter/sorter.cpp
@@ -1033,6 +1033,14 @@ void SortedFileWriter<Key, Value>::spill() {
try {
_file.write(reinterpret_cast<const char*>(&size), sizeof(size));
_file.write(outBuffer, std::abs(size));
+ } catch (const std::system_error& ex) {
+ if (ex.code() == std::errc::no_space_on_device) {
+ msgasserted(ErrorCodes::OutOfDiskSpace,
+ str::stream() << ex.what() << ": " << _fileName);
+ }
+ msgasserted(5642403,
+ str::stream() << "error writing to file \"" << _fileName
+ << "\": " << sorter::myErrnoWithDescription());
} catch (const std::exception&) {
msgasserted(16821,
str::stream() << "error writing to file \"" << _fileName