1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Server: Clarify error message when user info cannot be saved

This commit is contained in:
Laurent Cozic 2021-07-16 17:05:15 +01:00
parent 92520e58fb
commit 4567b78f0c

View File

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