Skip to content

Commit 35ef73a

Browse files
authored
Merge pull request caprover#1412 from djexvr/master
Throw error with status code on empty namespace
2 parents ff5e55c + 772827d commit 35ef73a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/datastore/DataStoreProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ const dataStoreCache: IHashMapGeneric<DataStore> = {}
1111
export default {
1212
getDataStore: function (namespace: string) {
1313
if (!namespace) {
14-
throw new Error('NameSpace is empty')
14+
throw ApiStatusCodes.createError(
15+
ApiStatusCodes.STATUS_ERROR_NOT_AUTHORIZED,
16+
'Empty namespace'
17+
)
1518
}
1619

1720
if (namespace !== CaptainConstants.rootNameSpace) {

0 commit comments

Comments
 (0)