Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

Implement function for creating errors with binary details field #191

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions tower-grpc/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,15 @@ impl Status {
}
}

/// Create a new `Status` with the associated code, message, and binary details field.
pub fn with_raw_details(code: Code, message: impl Into<String>, details: Bytes) -> Status {
Status {
code,
message: message.into(),
details: details,
}
}

// Deprecated: this constructor encourages creating statuses with no
// message, hurting later debugging.
#[doc(hidden)]
Expand Down