message: The code that checks for instanceof Warning is flawed because Analyzer delivers many Warnings as generic objects, passing typecheck purely by interface.  This fixes that by looking for code and message properties.
diff: @@ -18,7 +18,9 @@ export function getAnalysisDocument(analysis: Analysis, url: string): Document {
  if (document instanceof Document) {
  return document;
  }
  - if (document instanceof Warning || !document) {
  + if (document instanceof Warning || !document ||
  + (typeof document === 'object' && document['code'] &&
  + document['message'])) {
  const reason = document && document.message || 'unknown';
  const message = `Unable to get document ${url}: ${reason}`;
  throw new Error(message);
  