add userFriendly messages to PermissionsException (#13659)

/closes #13580

<img width="1186" height="754" alt="image"
src="https://github.com/user-attachments/assets/d5be9e3a-2748-4ad0-b29b-98038cbeeb6a"
/>
This commit is contained in:
neo773
2025-08-06 02:11:51 +05:30
committed by GitHub
parent 22eedb0281
commit a804d65210
11 changed files with 148 additions and 0 deletions
@@ -53,6 +53,10 @@ export class PermissionsService {
throw new PermissionsException(
PermissionsExceptionMessage.NO_ROLE_FOUND_FOR_USER_WORKSPACE,
PermissionsExceptionCode.NO_ROLE_FOUND_FOR_USER_WORKSPACE,
{
userFriendlyMessage:
'Your role in this workspace could not be found. Please contact your workspace administrator.',
},
);
}
@@ -162,6 +166,10 @@ export class PermissionsService {
throw new PermissionsException(
PermissionsExceptionMessage.API_KEY_ROLE_NOT_FOUND,
PermissionsExceptionCode.API_KEY_ROLE_NOT_FOUND,
{
userFriendlyMessage:
'The API key does not have a valid role assigned. Please check your API key configuration.',
},
);
}
@@ -180,6 +188,10 @@ export class PermissionsService {
throw new PermissionsException(
PermissionsExceptionMessage.NO_ROLE_FOUND_FOR_USER_WORKSPACE,
PermissionsExceptionCode.NO_ROLE_FOUND_FOR_USER_WORKSPACE,
{
userFriendlyMessage:
'Your role in this workspace could not be found. Please contact your workspace administrator.',
},
);
}
@@ -189,6 +201,10 @@ export class PermissionsService {
throw new PermissionsException(
PermissionsExceptionMessage.NO_AUTHENTICATION_CONTEXT,
PermissionsExceptionCode.NO_AUTHENTICATION_CONTEXT,
{
userFriendlyMessage:
'Authentication is required to access this feature. Please sign in and try again.',
},
);
}