Skip to content

Commit

Permalink
fix detail
Browse files Browse the repository at this point in the history
  • Loading branch information
wgtmac committed Dec 23, 2024
1 parent 7e858b8 commit 38d8edf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions cpp/src/arrow/status.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ const std::string& Status::message() const {
return ok() ? no_message : state_->msg;
}

const std::shared_ptr<StatusDetail>& Status::detail() const {
static std::shared_ptr<StatusDetail> no_detail = NULLPTR;
return state_ ? state_->detail : no_detail;
}

void Status::Abort() const { Abort(std::string()); }

void Status::Abort(const std::string& message) const {
Expand Down
5 changes: 1 addition & 4 deletions cpp/src/arrow/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,7 @@ class ARROW_EXPORT [[nodiscard]] Status : public util::EqualityComparable<Status
const std::string& message() const;

/// \brief Return the status detail attached to this message.
const std::shared_ptr<StatusDetail>& detail() const {
static std::shared_ptr<StatusDetail> no_detail = NULLPTR;
return state_ ? state_->detail : no_detail;
}
const std::shared_ptr<StatusDetail>& detail() const;

/// \brief Return a new Status copying the existing status, but
/// updating with the existing detail.
Expand Down

0 comments on commit 38d8edf

Please sign in to comment.