-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: replace simpleerror with thiserror
- Loading branch information
Showing
9 changed files
with
153 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#[derive(thiserror::Error, Debug)] | ||
pub enum LibError { | ||
#[error("value {0} not found")] | ||
ValueNotFound(u8), | ||
#[error("pos (row: {row}, col: {col}) out of bounds")] | ||
PosOutOfBounds { row: i32, col: i32 }, | ||
#[error("algorithm terminated without finding a solution")] | ||
TerminatedWithoutSolution, | ||
#[error("maximum number of steps ({0}) reached without finding a solution")] | ||
MaxNumStepsReached(usize), | ||
#[error("board is not square with width {width} and height {height}")] | ||
NotSquare { width: i32, height: i32 }, | ||
#[error("fields slice with {len} fields does not match board expecting {expected} fields")] | ||
FieldsBoardMismatch { len: usize, expected: i32 }, | ||
#[error("boards below 3x3 are not supported")] | ||
Below3x3, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ use ui::{ | |
use wasm_bindgen::prelude::*; | ||
|
||
pub mod board; | ||
pub mod error; | ||
pub mod solver; | ||
pub mod ui; | ||
|
||
|
Oops, something went wrong.