From 8783ed6473f71c8c47b2f0b95316fe1e46801a1a Mon Sep 17 00:00:00 2001 From: donniean Date: Wed, 25 Sep 2024 15:06:40 +0800 Subject: [PATCH 1/2] chore: improve page error messages Signed-off-by: donniean --- server/controllers/view.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/controllers/view.js b/server/controllers/view.js index fb7729d0ac2..f15e47beb1f 100644 --- a/server/controllers/view.js +++ b/server/controllers/view.js @@ -118,6 +118,12 @@ const renderViewErr = async (ctx, err) => { message: 'Unable to access the api server', }); } else { + await ctx.render('error', { + title: useDefaultTheme ? defaultTheme?.tabTitle : title, + favicon, + t: ctx.t.bind(ctx), + message: err.message, + }); ctx.app.emit('error', err); } } else { From 7777d5e22e95c3cf0605ff4bb014699c80327118 Mon Sep 17 00:00:00 2001 From: donniean Date: Wed, 25 Sep 2024 15:26:27 +0800 Subject: [PATCH 2/2] chore: remove error reason Signed-off-by: donniean --- server/controllers/view.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/controllers/view.js b/server/controllers/view.js index f15e47beb1f..17cefa3ca7b 100644 --- a/server/controllers/view.js +++ b/server/controllers/view.js @@ -122,7 +122,7 @@ const renderViewErr = async (ctx, err) => { title: useDefaultTheme ? defaultTheme?.tabTitle : title, favicon, t: ctx.t.bind(ctx), - message: err.message, + message: '', }); ctx.app.emit('error', err); }