mirror of
https://github.com/dadosfera/maestro.git
synced 2026-11-16 07:49:08 +00:00
FEAT: ROle management
This commit is contained in:
@@ -119,6 +119,13 @@ export function EnrichErrorCode(code: string) {
|
||||
message: 'Não é possível criar um grupo com esse nome',
|
||||
code,
|
||||
};
|
||||
case ErrorCodes.ROLE.NOT_FOUND:
|
||||
return {
|
||||
statusCode: HttpStatus.NOT_FOUND,
|
||||
error: 'Grupo não encontrado',
|
||||
message: 'Grupo solicitado não encontrado',
|
||||
code,
|
||||
};
|
||||
case ErrorCodes.INTERNAL:
|
||||
case ErrorCodes.UNKNOWN:
|
||||
default:
|
||||
@@ -138,9 +145,9 @@ const logger = new Logger();
|
||||
export default class ErrorBuilder extends HttpException {
|
||||
code: string;
|
||||
|
||||
constructor(code: string | RpcException) {
|
||||
constructor(code: string | RpcException = '') {
|
||||
if (typeof code !== 'string') {
|
||||
logger.log(code.stack);
|
||||
logger.log(code?.stack);
|
||||
code = (code as any).details as string;
|
||||
} else {
|
||||
logger.log(code);
|
||||
|
||||
@@ -15,6 +15,7 @@ export const AUTH = {
|
||||
};
|
||||
export const ROLE = {
|
||||
ALREADY_EXIST: 'ROLE.ALREADY_EXISTS',
|
||||
NOT_FOUND: 'ROLE.NOT_FOUND',
|
||||
};
|
||||
const ErrorCodes = {
|
||||
UNKNOWN: 'UNKNOWN',
|
||||
|
||||
Reference in New Issue
Block a user