From af834479514e9190ca6364aa3d6729c426bfeb11 Mon Sep 17 00:00:00 2001 From: teddit Date: Sun, 28 Mar 2021 16:55:16 +0200 Subject: [PATCH] improve error messages --- views/index.pug | 2 ++ views/subreddit.pug | 3 ++- views/subreddits_explore.pug | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/views/index.pug b/views/index.pug index d68b7cb..32b30e3 100644 --- a/views/index.pug +++ b/views/index.pug @@ -13,6 +13,8 @@ html if http_status_code == "401" || http_status_code == "503" p This error is probably caused because Reddit itself is down or having server issues. p Checking https://www.redditstatus.com might give some information. + if http_status_code == "404" + p The resource you were looking for was not found. else - var subreddit = '' if(user_preferences.subbed_subreddits && Array.isArray(user_preferences.subbed_subreddits)) diff --git a/views/subreddit.pug b/views/subreddit.pug index 20778c8..ad8b384 100644 --- a/views/subreddit.pug +++ b/views/subreddit.pug @@ -80,7 +80,8 @@ html li(class=past === 'all' ? 'active' : '') a(href="?t=all") all time if json.links.length === 0 - p nothing here + .reddit-error + p This subreddit either doesn't exist, or any posts weren't found. else each link in json.links .link diff --git a/views/subreddits_explore.pug b/views/subreddits_explore.pug index 9823a1f..55fa309 100644 --- a/views/subreddits_explore.pug +++ b/views/subreddits_explore.pug @@ -34,7 +34,8 @@ html input(type="submit", value="search") #links.sr.explore if json.links.length === 0 - p nothing here + .reddit-error + p This subreddit either doesn't exist, or any posts weren't found. else .infobar.explore p click the subscribe or unsubscribe buttons to choose which subreddits appear on the home feed.