Feature Description
As discussed in #5461 (comment), currently we have no way to define Go errors that properly translate to JS errors (e.g. TypeError), and the mechanisms that exist nowaday, like runtime.NewTypeError(...) are Go-compliant errors (satisfy error interface).
There's this draft proposal written by @oleiade which might be a very good starting point.
Suggested Solution (optional)
No response
Already existing or connected issues / PRs (optional)
No response