Commit 45b14c3c authored by Mark Harding's avatar Mark Harding
Browse files

(fix): do not throw error if missing item from feed

parent 94ac1b46
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -83,6 +83,7 @@ export class SentryErrorHandler implements ErrorHandler {
  handleError(error) {
  handleError(error) {
    // const eventId = Sentry.captureException(error.originalError || error);
    // const eventId = Sentry.captureException(error.originalError || error);
    // Sentry.showReportDialog({ eventId });
    // Sentry.showReportDialog({ eventId });
    console.error(error);
  }
  }
}
}


+11 −4
Original line number Original line Diff line number Diff line
import { Injectable } from '@angular/core';
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { BehaviorSubject, Observable, of } from 'rxjs';
import { first } from 'rxjs/operators';
import { first, catchError } from 'rxjs/operators';
import { Client } from '../../services/api';
import { Client } from '../../services/api';
import { BlockListService } from './block-list.service';
import { BlockListService } from './block-list.service';


@@ -64,8 +64,15 @@ export class EntitiesService {
    }
    }


    for (const feedItem of feed) {
    for (const feedItem of feed) {
      if (!blockedGuids || blockedGuids.indexOf(feedItem.owner_guid) < 0)
      if (
        entities.push(this.entities.get(feedItem.urn));
        this.entities.has(feedItem.urn) &&
        (!blockedGuids || blockedGuids.indexOf(feedItem.owner_guid) < 0)
      )
        entities.push(
          this.entities
            .get(feedItem.urn)
            .pipe(catchError(err => new BehaviorSubject(null)))
        );
    }
    }


    return entities;
    return entities;