readErrCause := js.Global().Get("Object").New()
readErrCause.Set("code", readErr.Error())
readErrCause.Set("value", js.ValueOf(readErr))
readErr := js.Global().Get("Error").New("ReadFull failed", readErrCause)
(where readErr is of the `error` type, of course)
Unfortunately,
readErrCause.Set("value", js.ValueOf(readErr))
does not work because, as the comment so perfectly says, ValueOf
// Panics if x is not one of the expected types.
I am absolutely up for proposing and implementing a small addition to the "js package" if people think it would be helpful but I wanted to check here first.
Again, thank you for all the great work that you *all* do!!
Sincerely,
Will