mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-21 09:14:34 +00:00
xous: don't panic when non-Ok is returned by send_message
Sometimes the queue is full, in which case something other than Ok is returned. Don't panic when this happens. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
179623e083
commit
87c7335afc
1 changed files with 4 additions and 4 deletions
|
|
@ -823,13 +823,13 @@ pub fn receive_message(server: SID) -> core::result::Result<MessageEnvelope, Err
|
||||||
///
|
///
|
||||||
/// * **ServerNotFound**: The server does not exist so the connection is now invalid
|
/// * **ServerNotFound**: The server does not exist so the connection is now invalid
|
||||||
/// * **BadAddress**: The client tried to pass a Memory message using an address it doesn't own
|
/// * **BadAddress**: The client tried to pass a Memory message using an address it doesn't own
|
||||||
|
/// * **ServerQueueFull**: The queue in the server is full, and this call would block
|
||||||
/// * **Timeout**: The timeout limit has been reached
|
/// * **Timeout**: The timeout limit has been reached
|
||||||
pub fn send_message(connection: CID, message: Message) -> core::result::Result<(), Error> {
|
pub fn send_message(connection: CID, message: Message) -> core::result::Result<(), Error> {
|
||||||
let result =
|
let result = rsyscall(SysCall::SendMessage(connection, message));
|
||||||
rsyscall(SysCall::SendMessage(connection, message)).expect("couldn't send message");
|
if let Ok(Result::Ok) = result {
|
||||||
if let Result::Ok = result {
|
|
||||||
Ok(())
|
Ok(())
|
||||||
} else if let Result::Error(e) = result {
|
} else if let Err(e) = result {
|
||||||
Err(e)
|
Err(e)
|
||||||
} else {
|
} else {
|
||||||
panic!("Unexpected return value: {:?}", result);
|
panic!("Unexpected return value: {:?}", result);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue