Skip to content

Commit

Permalink
Return both first and last error from mkpath.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Nov 5, 2021
1 parent 7d41d9e commit eb346f5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tdutils/td/utils/port/path.cpp
Expand Up @@ -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();
}
Expand Down

0 comments on commit eb346f5

Please sign in to comment.