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

Improve error formatting #488

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

ZhangYiJiang
Copy link
Contributor

Add new error formatter for prettifying errors emitted from Rivet. To do this I've attached the ChartNode object to the Error itself - it's not great but I think this is the best way to propagate node info to the formatter without having to add another wrapping Error class

),
),
`
Multiple errors
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would prefer snapshots for stuff like this, but I don't think there's an easy way to do this with the native package

@ZhangYiJiang
Copy link
Contributor Author

I think from reading the code recordings store and re-emit errors as strings, it might be useful to use this function there too but I'm having a little difficulty finding that place

@abrenneke
Copy link
Collaborator

This is great! Can we use it in the UI when displaying node errors? Or when showing errors in the console?

@ZhangYiJiang
Copy link
Contributor Author

Sure, can you point to where that is in the code? Or feel free to push up the changes onto this PR

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

Successfully merging this pull request may close these issues.

2 participants