Skip to content

Commit 6880cc3

Browse files
authored
Merge pull request #90 from kent-3/error-backtraces
include backtraces in keymap and keyset Errors
2 parents 68ad236 + 6de1e31 commit 6880cc3

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

packages/storage/src/keymap.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,7 @@ impl<'a, K: Serialize + DeserializeOwned, T: Serialize + DeserializeOwned, Ser:
455455
}
456456

457457
if start_pos > max_size {
458-
return Err(StdError::NotFound {
459-
kind: "out of bounds".to_string(),
460-
});
458+
return Err(StdError::not_found("out of bounds"));
461459
}
462460

463461
self.iter(storage)?
@@ -482,9 +480,7 @@ impl<'a, K: Serialize + DeserializeOwned, T: Serialize + DeserializeOwned, Ser:
482480
}
483481

484482
if start_pos > max_size {
485-
return Err(StdError::NotFound {
486-
kind: "out of bounds".to_string(),
487-
});
483+
return Err(StdError::not_found("out of bounds"));
488484
}
489485

490486
self.iter_keys(storage)?

packages/storage/src/keyset.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,7 @@ impl<'a, K: Serialize + DeserializeOwned, Ser: Serde> Keyset<'a, K, Ser, WithIte
309309
.map_err(|err| StdError::parse_err("u32", err))?;
310310
Ok(u32::from_be_bytes(pos_bytes))
311311
}
312-
None => Err(StdError::NotFound {
313-
kind: "keyset value not found.".to_string(),
314-
}),
312+
None => Err(StdError::not_found("keyset value not found.")),
315313
}
316314
}
317315

@@ -426,9 +424,7 @@ impl<'a, K: Serialize + DeserializeOwned, Ser: Serde> Keyset<'a, K, Ser, WithIte
426424
}
427425

428426
if start_pos > max_size {
429-
return Err(StdError::NotFound {
430-
kind: "out of bounds".to_string(),
431-
});
427+
return Err(StdError::not_found("out of bounds"));
432428
}
433429

434430
self.iter(storage)?

0 commit comments

Comments
 (0)