Skip to content

Commit 3a2ffb1

Browse files
zrhoss2165
authored andcommitted
feat: More helpful error messages in model import (#2264)
This PR adds more helpful error messages to model import to help debug errors that may occur during the migration to `hugr-model` as the default serialisation format (see #2260). The errors are still far from ideal, but should already provide a significant improvement. We hide the internals of `ImportError` in order to allow for the error messages to improve without incurring breaking changes. This PR also implements a remaining `todo!()` concerning importing tuple types.
1 parent 157c44e commit 3a2ffb1

File tree

6 files changed

+875
-645
lines changed

6 files changed

+875
-645
lines changed

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ result_large_err = "allow"
4242
large_enum_variant = "allow"
4343

4444
[workspace.dependencies]
45+
anyhow = "1.0.98"
4546
insta = { version = "1.43.1" }
4647
bitvec = "1.0.1"
4748
capnp = "0.20.6"

hugr-core/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ proptest-derive = { workspace = true }
7777
# Required for documentation examples
7878
hugr = { path = "../hugr" }
7979
serde_yaml = "0.9.34"
80+
anyhow = { workspace = true }

0 commit comments

Comments
 (0)