From 59f0eb23dcf3bf92dfd9072399cba13124d055a4 Mon Sep 17 00:00:00 2001 From: Rakan Alhneiti Date: Sun, 11 Jun 2023 19:54:46 +0300 Subject: [PATCH] Return None for no records --- raiden/state-machine/src/storage/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/raiden/state-machine/src/storage/mod.rs b/raiden/state-machine/src/storage/mod.rs index 3e576c9..312f2b1 100644 --- a/raiden/state-machine/src/storage/mod.rs +++ b/raiden/state-machine/src/storage/mod.rs @@ -386,7 +386,7 @@ impl StateStorage { let row = match rows.next().map_err(StorageError::Sql)? { Some(row) => row, - None => return Err(StorageError::Other("State change not found")), + None => return Ok(None), }; let identifier: StorageID = @@ -426,7 +426,7 @@ impl StateStorage { let row = match rows.next().map_err(StorageError::Sql)? { Some(row) => row, - None => return Err(StorageError::Other("Event not found")), + None => return Ok(None), }; let identifier: StorageID = row.get::(0).map_err(StorageError::Sql)?.try_into()?;