Skip to content

Commit

Permalink
feat: Add Status with Details Constructor (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cameron authored Mar 30, 2020
1 parent 2e082f8 commit cfd59db
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tonic/src/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,15 @@ impl Status {

Ok(())
}

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

impl fmt::Debug for Status {
Expand Down

0 comments on commit cfd59db

Please sign in to comment.