Skip to content

Commit ee06628

Browse files
authored
Merge pull request #67 from kinode-dao/da/docstring
await_next_request_body > await_next_message_body
2 parents ccf9db2 + 0a52bf7 commit ee06628

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/lib.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,10 @@ pub fn get_capability(our: &Address, params: &str) -> Option<Capability> {
217217
.cloned()
218218
}
219219

220-
pub fn await_next_request_body() -> anyhow::Result<Vec<u8>> {
221-
let Ok(Message::Request { body, .. }) = await_message() else {
222-
return Err(anyhow::anyhow!("failed to get request body, bailing out"));
223-
};
224-
Ok(body)
220+
/// get the next message body from the message queue, or propagate the error
221+
pub fn await_next_message_body() -> Result<Vec<u8>, SendError> {
222+
match await_message() {
223+
Ok(msg) => Ok(msg.body().to_vec()),
224+
Err(e) => Err(e.into()),
225+
}
225226
}

0 commit comments

Comments
 (0)