Skip to content

Commit 118e6c0

Browse files
committed
NC | replace invalid type error hard coded command types list with a dynamic list
Signed-off-by: Romy <[email protected]>
1 parent 5df2d8f commit 118e6c0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/manage_nsfs/manage_nsfs_cli_errors.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
const config = require('../../config');
55
const NoobaaEvent = require('../manage_nsfs/manage_nsfs_events_utils').NoobaaEvent;
6+
const { TYPES } = require('../manage_nsfs/manage_nsfs_constants');
67

78
// by default NC_DISABLE_POSIX_MODE_ACCESS_CHECK=true, therefore CLI access check of account/bucket will be based on stat (open file)
89
// which checks only read permissions.
@@ -100,7 +101,7 @@ ManageCLIError.UnsetArgumentIsInvalid = Object.freeze({
100101

101102
ManageCLIError.InvalidType = Object.freeze({
102103
code: 'InvalidType',
103-
message: 'Invalid type, available types are account, bucket, logging, whitelist, upgrade, notification or connection.',
104+
message: `Invalid type, valid types are ${Object.values(TYPES).join(', ')}.`,
104105
http_code: 400,
105106
});
106107

0 commit comments

Comments
 (0)