ifc_lite_geometry_runtime/
worker_error.rs1#[derive(Debug)]
5pub enum WorkerError {
6 Io(std::io::Error),
7 Protocol(&'static str),
8 Kernel {
9 status: i32,
10 message: String,
11 },
12 WrongWorker,
13 InvalidArgument(&'static str),
15 ResourceLimit(&'static str),
16 Unqualified(&'static str),
19}
20
21impl std::fmt::Display for WorkerError {
22 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
23 match self {
24 Self::Io(error) => write!(f, "geometry worker IO: {error}"),
25 Self::Protocol(message) => write!(f, "geometry worker protocol: {message}"),
26 Self::Kernel { status, message } => {
27 write!(f, "geometry worker status {status}: {message}")
28 }
29 Self::InvalidArgument(message) => {
30 write!(f, "invalid geometry worker argument: {message}")
31 }
32 Self::WrongWorker => write!(f, "BRep handle belongs to another worker"),
33 Self::ResourceLimit(message) => write!(f, "geometry worker resource limit: {message}"),
34 Self::Unqualified(message) => write!(f, "unqualified retained request: {message}"),
35 }
36 }
37}
38impl std::error::Error for WorkerError {}
39impl From<std::io::Error> for WorkerError {
40 fn from(error: std::io::Error) -> Self {
41 Self::Io(error)
42 }
43}