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