From 4567b78f0c1277eb614817f909593b3753abdf3f Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Fri, 16 Jul 2021 17:05:15 +0100 Subject: [PATCH] Server: Clarify error message when user info cannot be saved --- packages/server/src/routes/index/users.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/server/src/routes/index/users.ts b/packages/server/src/routes/index/users.ts index ae4b6db48..e1396e02a 100644 --- a/packages/server/src/routes/index/users.ts +++ b/packages/server/src/routes/index/users.ts @@ -270,6 +270,7 @@ router.post('users', async (path: SubPath, ctx: AppContext) => { return redirect(ctx, `${config().baseUrl}/users${userIsMe(path) ? '/me' : ''}`); } catch (error) { + error.message = `Error: Your changes were not saved: ${error.message}`; if (error instanceof ErrorForbidden) throw error; const endPoint = router.findEndPoint(HttpMethod.GET, 'users/:id'); return endPoint.handler(path, ctx, user, error);