Show days API errors properly

cache
Varun Patil 2022-10-06 11:49:51 -07:00
parent f09322d866
commit 515addf497
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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--;
}