Return both first and last error from mkpath.

This commit is contained in:
levlam 2021-11-05 10:10:11 +03:00
parent 7d41d9eaa5
commit eb346f5573

View File

@ -75,7 +75,10 @@ Status mkpath(CSlice path, int32 mode) {
}
}
if (last_error.is_error()) {
return first_error;
if (last_error.message() == first_error.message() && last_error.code() == first_error.code()) {
return first_error;
}
return last_error.move_as_error_suffix(PSLICE() << ": " << first_error);
}
return Status::OK();
}