From 515addf497b4983608d2df68722505ab9fee2f59 Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Thu, 6 Oct 2022 11:49:51 -0700 Subject: [PATCH] Show days API errors properly --- lib/Controller/ApiController.php | 2 +- src/components/Timeline.vue | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Controller/ApiController.php b/lib/Controller/ApiController.php index c260e88c..91e9e468 100644 --- a/lib/Controller/ApiController.php +++ b/lib/Controller/ApiController.php @@ -148,7 +148,7 @@ class ApiController extends Controller { $recursive = is_null($this->request->getParam('folder')); $archive = !is_null($this->request->getParam('archive')); if (is_null($folder)) { - return new JSONResponse([], Http::STATUS_NOT_FOUND); + return new JSONResponse(["message" => "Timeline folder not found"], Http::STATUS_NOT_FOUND); } // Run actual query diff --git a/src/components/Timeline.vue b/src/components/Timeline.vue index 7e7bad70..01eba971 100644 --- a/src/components/Timeline.vue +++ b/src/components/Timeline.vue @@ -563,6 +563,9 @@ export default class Timeline extends Mixins(GlobalMixin, UserConfig) { const data = res.data; if (this.state !== startState) return; await this.processDays(data); + } catch (err) { + console.error(err); + showError(err?.response?.data?.message || err.message); } finally { this.loading--; }