diff --git a/ftl/core/statistics.ftl b/ftl/core/statistics.ftl index 0b5fc5eb5..8b122a644 100644 --- a/ftl/core/statistics.ftl +++ b/ftl/core/statistics.ftl @@ -172,7 +172,6 @@ statistics-elapsed-time-years = { $amount }y ## -statistics-error-fetching = Error searching - please check your search is correct, or use the Check Database feature. statistics-average-for-days-studied = Average for days studied statistics-total = Total statistics-days-studied = Days studied diff --git a/qt/aqt/mediasrv.py b/qt/aqt/mediasrv.py index 5482b849f..b37282afc 100644 --- a/qt/aqt/mediasrv.py +++ b/qt/aqt/mediasrv.py @@ -287,11 +287,14 @@ def handle_post(path: str) -> Response: return flask.make_response("Collection not open", HTTPStatus.NOT_FOUND) if path in post_handlers: - if data := post_handlers[path](): - response = flask.make_response(data) - response.headers["Content-Type"] = "application/binary" - else: - response = flask.make_response("", HTTPStatus.NO_CONTENT) + try: + if data := post_handlers[path](): + response = flask.make_response(data) + response.headers["Content-Type"] = "application/binary" + else: + response = flask.make_response("", HTTPStatus.NO_CONTENT) + except Exception as e: + return flask.make_response(str(e), HTTPStatus.INTERNAL_SERVER_ERROR) else: response = flask.make_response( f"Unhandled post to {path}", diff --git a/ts/graphs/GraphsPage.svelte b/ts/graphs/GraphsPage.svelte index 2597a09f0..05ade8f0b 100644 --- a/ts/graphs/GraphsPage.svelte +++ b/ts/graphs/GraphsPage.svelte @@ -37,7 +37,7 @@ revlogRange = daysToRevlogRange(days); } catch (e) { sourceData = null; - alert(i18n.tr(i18n.TR.STATISTICS_ERROR_FETCHING)); + alert(e); } active = false; }; diff --git a/ts/lib/postrequest.ts b/ts/lib/postrequest.ts index 100fe668f..a3075361b 100644 --- a/ts/lib/postrequest.ts +++ b/ts/lib/postrequest.ts @@ -7,7 +7,8 @@ export async function postRequest(path: string, body: string): Promise