Stream: git-wasmtime

Topic: wasmtime / issue #6782 Forward TypeChecker definiton erro...


view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2023 at 21:41):

jameysharp commented on issue #6782:

Thanks for suggesting an improvement to error reporting! But I'm confused by this change. .with_context is supposed to add context to the error, not replace it. So the message in e.to_string() should already be available from the returned error. See the documentation on anyhow::Context.

I suspect if you didn't see the "Caused by:" chain in the error output, then the root issue here is that something is not printing errors in the right way. Can you provide more information about what you tried and what output you got?

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2023 at 22:01):

zarkone commented on issue #6782:

@jameysharp you are right, thank you! That was not obvious to me. Sorry for rubberducking you instead of reading the docs >..<

For the context (pun intended), anyhow::Context prints only context part of error using Display printer {}. In order to print full info, including "source", {:#} should be used.

https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations

view this post on Zulip Wasmtime GitHub notifications bot (Jul 27 2023 at 22:02):

zarkone edited a comment on issue #6782:

@jameysharp you are right, thank you! That was not obvious to me. Sorry for rubberducking you instead of reading the docs >..<

For the context (pun intended), anyhow::Error prints only context part of error using Display printer {}. In order to print full info, including "source", {:#} should be used.

https://docs.rs/anyhow/latest/anyhow/struct.Error.html#display-representations


Last updated: Nov 22 2024 at 16:03 UTC