This handles errors thrown from the other thread. In 8.1.0 and earlier, such errors weren't handled at all. In 8.2.0 prior to this PR, we caught the errors and dispatched them as onError events.
This PR distinguishes the two sources of error (throw and sendError()), and also enables the user to get the stack trace for a thrown error.
If the user doesn't add a listener, we instead use Log.error() to ensure that something shows up in the console. (We don't want to suddenly start hiding errors.)
This handles errors thrown from the other thread. In 8.1.0 and earlier, such errors weren't handled at all. In 8.2.0 prior to this PR, we caught the errors and dispatched them as
onError
events.This PR distinguishes the two sources of error (
throw
andsendError()
), and also enables the user to get the stack trace for a thrown error.If the user doesn't add a listener, we instead use
Log.error()
to ensure that something shows up in the console. (We don't want to suddenly start hiding errors.)