From 68fb0ef5fbc1e873f9013224209af40965fc8ebf Mon Sep 17 00:00:00 2001 From: fflorent Date: Fri, 22 Nov 2024 18:48:13 +0100 Subject: [PATCH] Log errors --- app/server/lib/scim/v2/ScimUserController.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/server/lib/scim/v2/ScimUserController.ts b/app/server/lib/scim/v2/ScimUserController.ts index 4aec86d6b3..48d2d4601b 100644 --- a/app/server/lib/scim/v2/ScimUserController.ts +++ b/app/server/lib/scim/v2/ScimUserController.ts @@ -3,6 +3,7 @@ import { HomeDBManager, Scope } from 'app/gen-server/lib/homedb/HomeDBManager'; import SCIMMY from 'scimmy'; import { toSCIMMYUser, toUserProfile } from './ScimUserUtils'; import { RequestContext } from './ScimTypes'; +import log from 'app/server/lib/log'; class ScimUserController { private static _getIdFromResource(resource: any) { @@ -111,15 +112,18 @@ class ScimUserController { return await cb(); } catch (err) { if (err instanceof ApiError) { + log.error('[ScimUserController] ApiError: ', err.status, err.message); if (err.status === 409) { throw new SCIMMY.Types.Error(err.status, 'uniqueness', err.message); } throw new SCIMMY.Types.Error(err.status, null!, err.message); } if (err instanceof SCIMMY.Types.Error) { + log.error('[ScimUserController] SCIMMY.Types.Error: ', err.message); throw err; } // By default, return a 500 error + log.error('[ScimUserController] Error: ', err.message); throw new SCIMMY.Types.Error(500, null!, err.message); } }