-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix to not have unneeded console errors #4482
base: main
Are you sure you want to change the base?
Conversation
QA Wolf here! As you write new code it's important that your test coverage is keeping up. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Nice, but what happens when we do need the stack trace? new Reason(new Error().stack) ? |
You would not use |
} else if (!err(sg)) { | ||
processedMemory[key] = sg.paths.map(({ __geoMeta, ...rest }: Path) => { | ||
} else if (!(sk instanceof Reason)) { | ||
processedMemory[key] = sk.paths.map(({ __geoMeta, ...rest }: Path) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you can assure me this is actually not an error, I'll approve this to add to our toolbox.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? The return type of sketchFromKclValueOptional()
cannot return an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The point of this component is to display everything in memory in the UI. The only reason it checks for a sketch is so that it can be displayed differently from other types of values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me except the one thing I'd like to see before approving
2c21297
to
4affd77
Compare
We were logging errors when there were no actual problems. The variables pane is one place, but there are others.
This adds an optional variant of a function that was generating errors.
This also adds a
Reason
class that can be used in this pattern where you don't want to duplicate logic, but you also don't want to generate an error only to throw it away in the caller.The root cause is the
console.error()
in ourerr()
function.Slack