fix(server/errors): derive errors from BaseError (#3918)
This commit is contained in:
@@ -9,6 +9,7 @@ import { registerOrUpdateRole } from '@/modules/shared/repositories/roles'
|
||||
import { initializeEventListenersFactory } from '@/modules/workspaces/events/eventListener'
|
||||
import { validateModuleLicense } from '@/modules/gatekeeper/services/validateLicense'
|
||||
import { getSsoRouter } from '@/modules/workspaces/rest/sso'
|
||||
import { InvalidLicenseError } from '@/modules/gatekeeper/errors/license'
|
||||
|
||||
const { FF_WORKSPACES_MODULE_ENABLED, FF_WORKSPACES_SSO_ENABLED } = getFeatureFlags()
|
||||
|
||||
@@ -32,7 +33,7 @@ const workspacesModule: SpeckleModule = {
|
||||
})
|
||||
|
||||
if (!isWorkspaceLicenseValid)
|
||||
throw new Error(
|
||||
throw new InvalidLicenseError(
|
||||
'The workspaces module needs a valid license to run, contact Speckle to get one.'
|
||||
)
|
||||
moduleLogger.info('⚒️ Init workspaces module')
|
||||
|
||||
Reference in New Issue
Block a user