Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make struct InnerError public #478

Open
linw1995 opened this issue Nov 8, 2022 · 2 comments
Open

Make struct InnerError public #478

linw1995 opened this issue Nov 8, 2022 · 2 comments

Comments

@linw1995
Copy link

linw1995 commented Nov 8, 2022

liquid-rust version: 0.26
rust version: 1.64.0
OS: Darwin 22.1.0

I've been trying to handle errors, and try to provide a user-friendly tip. For example, I need to get the requested variable from this error Error { inner: InnerError { msg: "Unknown variable", user_backtrace: [Trace { trace: None, context: [("requested variable", "num")] }], cause: None } }. But due to the InnerError being a private struct, there is nothing I can do then.

@epage
Copy link
Member

epage commented Jan 9, 2023

Sorry for the delay, I was occupied with some family things.

Before discussing how we should support this, could you provide details of what all details you are interested in? And in what ways are you trying to provide tips?

@nickdavies
Copy link

I ran into a similar problem although I will admit it's quite niche. I have a usecase where I am trying to do some automatic porting of a large number of templates and I am filtering templates into what features (tags/filters etc) I want to support.

So for me I would love to be able to have access to the internal error details for two reasons:

  1. To have more control over the output formatting (Eg I want to put them on a single line or make them more grepable).
  2. I would really like to be able to figure out what the root failure is so that I can filter out errors into expected and get more visibility into what tags/filters would unlock the most benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants