From 548011ba6316e83c95b327768581d7d53d49a63e Mon Sep 17 00:00:00 2001 From: Sakarias Johansson Date: Fri, 3 Mar 2023 15:56:26 +0100 Subject: =?UTF-8?q?=F0=9F=9B=A0=20Cleanup=20error=20handling=20&=20functio?= =?UTF-8?q?nalize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- racer-tracer/src/error.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'racer-tracer/src/error.rs') diff --git a/racer-tracer/src/error.rs b/racer-tracer/src/error.rs index f32dac9..6e1b305 100644 --- a/racer-tracer/src/error.rs +++ b/racer-tracer/src/error.rs @@ -1,6 +1,6 @@ use thiserror::Error; -#[derive(Clone, Error, Debug)] +#[derive(Clone, Error, Debug, PartialEq, Eq)] pub enum TracerError { #[error("Unknown error: {message}")] Unknown { message: String, exit_code: i32 }, @@ -22,6 +22,15 @@ pub enum TracerError { #[error("No scene supplied.")] NoScene(), + + #[error("Failed to acquire lock \"{0}\"")] + FailedToAcquireLock(String), + + #[error("Exit event")] + ExitEvent, + + #[error("Cancel event")] + CancelEvent, } impl From for i32 { @@ -37,6 +46,9 @@ impl From for i32 { TracerError::Configuration(_, _) => 5, TracerError::UnknownMaterial(_) => 6, TracerError::NoScene() => 7, + TracerError::FailedToAcquireLock(_) => 8, + TracerError::ExitEvent => 9, + TracerError::CancelEvent => 10, } } } -- cgit v1.2.3