Skip to content

Commit

Permalink
[BugFix] fix fs posix errno mapping rules (backport #51411) (#51425)
Browse files Browse the repository at this point in the history
Co-authored-by: Yixin Luo <[email protected]>
  • Loading branch information
mergify[bot] and luohaha authored Sep 26, 2024
1 parent 1d22fb9 commit 3b191a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion be/src/fs/fs_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,16 @@ static Status io_error(const std::string& context, int err_number) {
switch (err_number) {
case 0:
return Status::OK();
case EIO:
return Status::IOError(fmt::format("{}: {}", context, std::strerror(err_number)));
case ENOENT:
return Status::NotFound(fmt::format("{}: {}", context, std::strerror(err_number)));
case EEXIST:
return Status::AlreadyExist(fmt::format("{}: {}", context, std::strerror(err_number)));
case ENOSPC:
return Status::CapacityLimitExceed(fmt::format("{}: {}", context, std::strerror(err_number)));
default:
return Status::IOError(fmt::format("{}: {}", context, std::strerror(err_number)));
return Status::InternalError(fmt::format("{}: {}", context, std::strerror(err_number)));
}
}

Expand Down

0 comments on commit 3b191a6

Please sign in to comment.