From c52a05e6d3977efce6bd4479aa312dc90e0452e5 Mon Sep 17 00:00:00 2001 From: tcmal Date: Sun, 25 Aug 2024 17:44:23 +0100 Subject: feat(render): proper error handling --- stockton-render/src/draw/texture/repo.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'stockton-render/src/draw/texture/repo.rs') diff --git a/stockton-render/src/draw/texture/repo.rs b/stockton-render/src/draw/texture/repo.rs index d5200be..8191f7b 100644 --- a/stockton-render/src/draw/texture/repo.rs +++ b/stockton-render/src/draw/texture/repo.rs @@ -129,8 +129,11 @@ impl<'a> TextureRepo<'a> { }) } - pub fn get_ds_layout(&self) -> RwLockReadGuard { - self.ds_layout.read().unwrap() + pub fn get_ds_layout(&self) -> Result> { + self.ds_layout + .read() + .map_err(|_| LockPoisoned::Other) + .context("Error locking descriptor set layout") } pub fn queue_load(&mut self, block_id: BlockRef) -> Result<()> { -- cgit v1.2.3