function failOnError(messageHeader, error) {
  let message = `${messageHeader}: ${error}`;
  // Shaka errors have the stack trace in their toString() already, so don't
  // add it again.  For native errors, we need to see where it came from.
  if (error && error.stack && !(error instanceof shaka.util.Error)) {
    message += '\n' + error.stack;
  }
  fail(message);
}
Fail the current test on a given error, constructed with a given header and
the full stack trace of the error.

@param {string} messageHeader
@param {!Error} error