socialnetworknews-web

A open-source Paper.li clone
git clone git://archive.git.mtrnord.blog/SocialNetworkNews/socialnetworknews-web.git
Log | Files | Refs | README | LICENSE

commit 134c5bae16baaadddff9b26f4d84ef4cd58f4f54
parent c8ecd9a6f0f66a7ae7ed1c2b531b04beea09e713
Author: MTRNord <mtrnord1@gmail.com>
Date:   Tue, 13 Mar 2018 19:46:57 +0100

Show actual error Message when getting 404

Diffstat:
Msrc/app/papers-list/papers-list.component.ts | 2+-
Msrc/app/tweet-list/tweet-list.component.ts | 4+++-
2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/app/papers-list/papers-list.component.ts b/src/app/papers-list/papers-list.component.ts @@ -36,7 +36,7 @@ export class PapersListComponent { if (String(error.status).startsWith('50')) { return Observable.of(error.status).delay(1000); } - return Observable.throw({error: 'No retry'}); + return Observable.throw({error: 'Unknown error'}); }) .take(5) // TODO: Allow to link to a Status Page diff --git a/src/app/tweet-list/tweet-list.component.ts b/src/app/tweet-list/tweet-list.component.ts @@ -43,8 +43,10 @@ export class TweetListComponent implements OnInit { .mergeMap((error: any) => { if (String(error.status).startsWith('50')) { return Observable.of(error.status).delay(1000); + } else if (error.status === 404) { + return Observable.throw({error: 'Sorry, there was an error. The Server just doesn\'t find any data for the requested time :('}); } - return Observable.throw({error: 'No retry'}); + return Observable.throw({error: 'Unknown error'}); }) .take(5) // TODO: Allow to link to a Status Page