1use thiserror::Error;
2
3#[derive(Debug, PartialEq, Eq, Error)]
5pub enum Error {
6 #[error(transparent)]
8 FromTopology(#[from] truck_topology::errors::Error),
9 #[error("cannot attach a plane to a wire that is not on one plane.")]
12 WireNotInOnePlane,
13 #[error("The wires must contain the same number of edges to create a homotopy.")]
16 NotSameNumberOfEdges,
17}
18
19#[test]
20fn print_messages() {
21 use std::io::Write;
22 writeln!(
23 &mut std::io::stderr(),
24 "****** test of the expressions of error messages ******\n"
25 )
26 .unwrap();
27 writeln!(
28 &mut std::io::stderr(),
29 "{}\n",
30 Error::FromTopology(truck_topology::errors::Error::SameVertex)
31 )
32 .unwrap();
33 writeln!(&mut std::io::stderr(), "{}\n", Error::WireNotInOnePlane).unwrap();
34 writeln!(
35 &mut std::io::stderr(),
36 "*******************************************************"
37 )
38 .unwrap();
39}