function wrapRuntimeEvalErrorInBrowser(err) {
  if (!err || typeof err === 'string') {
    err = new Error(err);
  }

  return {
    __failedInBrowser: true,
    name: err.name || 'Error',
    message: err.message || 'unknown error',
    stack: err.stack,
  };
}
The `exceptionDetails` provided by the debugger protocol does not contain the useful
information such as name, message, and stack trace of the error when it's wrapped in a
promise. Instead, map to a successful object that contains this information.
@param {string|Error} [err] The error to convert
@return {{__failedInBrowser: boolean, name: string, message: string, stack: string|undefined}}