This adds custom errors to the lambda function instead of panics.
Previously, we used anyhow for errors and `expect` when unwrapping results. Reorganizes the file structure.This has all been replaced by custom error types in a new file called `error.rs`
Depends on D10788