projectsyn/reclass-rs

Improve error message for failed reference lookups

Closed this issue · 0 comments

Summary

We currently generate an error message containing the complete parameters object for failed reference lookups, cf.

let mut v = self
.interpolate(root, &mut state)
.map_err(|e| anyhow!("While resolving references in {self}: {e}"))?;

While this is manageable when using small test inventories, this generates a massive error message for real-world Project Syn inventories.

Python reclass uses the following error type for failed reference lookups: https://github.com/kapicorp/reclass/blob/856b34cb77811d665c6346883238d436ac5c4924/reclass/errors.py#L202-L210

Acceptance criteria

  • Adjust the reference lookup error message to be more concise
  • Release reclass-rs

Implementation ideas

  • Try to mimic the Python reclass error message
  • If necessary, track additional state during reference resolution