Skip to content

Commit 677e01b

Browse files
committed
#RI-4699 - fix pr comments
1 parent 10a7a56 commit 677e01b

File tree

3 files changed

+2
-6
lines changed

3 files changed

+2
-6
lines changed

redisinsight/api/src/constants/error-messages.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,4 @@ export default {
6868
INVALID_WINDOW_ID: 'Invalid window id.',
6969
UNDEFINED_WINDOW_ID: 'Undefined window id.',
7070
LIBRARY_NOT_EXIST: 'This library does not exist.',
71-
NO_PERMISSION_COMMAND_INFO: 'This user has no permissions to run the \'info\' command.',
7271
};

redisinsight/api/src/modules/database/providers/database-info.provider.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,6 @@ describe('DatabaseInfoProvider', () => {
380380
fail('Should throw an error');
381381
} catch (err) {
382382
expect(err).toBeInstanceOf(ForbiddenException);
383-
expect(err.message).toEqual(ERROR_MESSAGES.NO_PERMISSION_COMMAND_INFO);
384383
}
385384
});
386385
});

redisinsight/api/src/modules/database/providers/database-info.provider.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BadRequestException, Injectable, ForbiddenException } from '@nestjs/common';
1+
import { BadRequestException, Injectable } from '@nestjs/common';
22
import * as IORedis from 'ioredis';
33
import {
44
IRedisClusterInfo,
@@ -242,9 +242,7 @@ export class DatabaseInfoProvider {
242242
server: serverInfo,
243243
};
244244
} catch (error) {
245-
if (error.message.includes('NOPERM this user has no permissions to run the \'info\' command')) {
246-
throw new ForbiddenException(ERROR_MESSAGES.NO_PERMISSION_COMMAND_INFO);
247-
}
245+
throw catchAclError(error);
248246
}
249247
}
250248

0 commit comments

Comments
 (0)