Skip to content

Conversation

@TimDiekmann
Copy link
Member

@TimDiekmann TimDiekmann commented Jun 3, 2022

🌟 What is the purpose of this PR?

For convenience, we want to attach any data without implementing a trait.

🔗 Related links

🔍 What does this change?

  • Rename attach_message to attach
  • Support any displayable data in attach_message

⚠️ Known issues

  • Until Error is moved to core, we need to work around that in the doc string

📹 Demo

let error = fs::read_to_string("config.txt")
    .report()
    .attach(Suggestion("Better use a file which exists next time!"));

@TimDiekmann
Copy link
Member Author

As discussed off-GitHub, we will combine attach_message and provide. Marking this PR as a Draft and closing the reviews for now.

@TimDiekmann TimDiekmann marked this pull request as draft June 3, 2022 13:26
@TimDiekmann TimDiekmann changed the title Add Report::provide method Support any data to be passed by attach (replace attach_message) Jun 3, 2022
# Conflicts:
#	packages/engine/bin/cli/src/main.rs
#	packages/engine/bin/hash_engine/src/main.rs
#	packages/engine/lib/error/src/lib.rs
#	packages/engine/lib/error/src/macros.rs
@TimDiekmann TimDiekmann marked this pull request as ready for review June 3, 2022 13:56
Copy link
Contributor

@Alfred-Mountfield Alfred-Mountfield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a big fan of how much this has simplified things.

Can you look through the comments for references to old things like "message", "provider" (in the wrong places), etc.

TimDiekmann and others added 6 commits June 3, 2022 17:42
Co-authored-by: Alfred Mountfield <am@hash.ai>
Co-authored-by: Alfred Mountfield <am@hash.ai>
Co-authored-by: Alfred Mountfield <am@hash.ai>
Co-authored-by: Alfred Mountfield <am@hash.ai>
@TimDiekmann TimDiekmann enabled auto-merge (squash) June 6, 2022 09:51
@TimDiekmann TimDiekmann merged commit 649eab4 into main Jun 6, 2022
@TimDiekmann TimDiekmann deleted the td/provide-directly branch June 6, 2022 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants