aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortcmal <me@aria.rip>2024-08-25 17:44:24 +0100
committertcmal <me@aria.rip>2024-08-25 17:44:24 +0100
commit6b8395152b8e0c7ddd714e195e4e92d464b8147c (patch)
treefa4c44f4abad507dbde4c42d6c0b982ac1814be2
parentdf4271047b6e482cbeaa099f819c797860b96d18 (diff)
refactor(skeleton): move LevelError to render
-rw-r--r--stockton-render/Cargo.toml1
-rw-r--r--stockton-render/src/level.rs10
-rw-r--r--stockton-skeleton/src/error.rs11
3 files changed, 14 insertions, 8 deletions
diff --git a/stockton-render/Cargo.toml b/stockton-render/Cargo.toml
index e6ac094..1329443 100644
--- a/stockton-render/Cargo.toml
+++ b/stockton-render/Cargo.toml
@@ -20,3 +20,4 @@ legion = { version = "^0.3" }
log = "0.4.0"
winit = "^0.21"
nalgebra-glm = "^0.6"
+thiserror = "1.0.25"
diff --git a/stockton-render/src/level.rs b/stockton-render/src/level.rs
index 0c88a0b..c9a8155 100644
--- a/stockton-render/src/level.rs
+++ b/stockton-render/src/level.rs
@@ -15,7 +15,7 @@ use stockton_skeleton::{
},
context::RenderingContext,
draw_passes::{util::TargetSpecificResources, DrawPass, IntoDrawPass, PassPosition},
- error::{LevelError, LockPoisoned},
+ error::LockPoisoned,
mem::{DataPool, DepthBufferPool, StagingPool, TexturesPool},
queue_negotiator::QueueNegotiator,
texture::{resolver::TextureResolver, TexLoadQueue, TextureLoadConfig, TextureRepo},
@@ -49,6 +49,7 @@ use hal::{
};
use legion::{Entity, IntoQuery};
use shaderc::ShaderKind;
+use thiserror::Error;
/// The Vertexes that go to the shader
#[derive(Debug, Clone, Copy)]
@@ -468,3 +469,10 @@ where
])
}
}
+
+/// Indicates an issue with the level object being used
+#[derive(Debug, Error)]
+pub enum LevelError {
+ #[error("Referential Integrity broken")]
+ BadReference,
+}
diff --git a/stockton-skeleton/src/error.rs b/stockton-skeleton/src/error.rs
index 15df7ff..d9d0ceb 100644
--- a/stockton-skeleton/src/error.rs
+++ b/stockton-skeleton/src/error.rs
@@ -2,6 +2,8 @@
use thiserror::Error;
+/// An error caused by a lock being poisoned.
+/// This indicates an issue somewhere else, in another thread.
#[derive(Error, Debug)]
pub enum LockPoisoned {
#[error("Device lock poisoned")]
@@ -51,6 +53,7 @@ pub enum EnvironmentError {
MemoryPoolMissing,
}
+/// Indicates invalid usage of an API.
#[derive(Debug, Error)]
pub enum UsageError {
#[error("Attempt to create mappable memory block from non-mappable memory")]
@@ -60,13 +63,7 @@ pub enum UsageError {
QueueNegotiatorMisuse,
}
-/// Indicates an issue with the level object being used
-#[derive(Debug, Error)]
-pub enum LevelError {
- #[error("Referential Integrity broken")]
- BadReference,
-}
-
+/// Displays an error with full backtrace
pub fn full_error_display(err: anyhow::Error) -> String {
let cont = err
.chain()