Skip to content

Commit 16f0c20

Browse files
authored
Propagate error on loading Receiver (payjoin#720)
Closes payjoin#718
2 parents 8704226 + 6da6cf4 commit 16f0c20

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

payjoin-ffi/src/receive/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ impl Receiver {
8787
token: P::Token,
8888
persister: &P,
8989
) -> Result<Self, ImplementationError> {
90-
Ok(Receiver::from(persister.load(token).unwrap()))
90+
let p = persister.load(token).map_err(|e| ImplementationError::from(e.to_string()))?;
91+
Ok(Receiver::from(p))
9192
}
9293

9394
pub fn extract_req(&self, ohttp_relay: String) -> Result<(Request, ClientResponse), Error> {

0 commit comments

Comments
 (0)