fix(server/errors): derive errors from BaseError (#3918)
This commit is contained in:
@@ -5,6 +5,7 @@ import { db } from '@/db/knex'
|
||||
import { PaidWorkspacePlanStatuses } from '@/modules/gatekeeper/domain/billing'
|
||||
import { upsertPaidWorkspacePlanFactory } from '@/modules/gatekeeper/repositories/billing'
|
||||
import { PaidWorkspacePlans } from '@/modules/gatekeeper/domain/workspacePricing'
|
||||
import { WorkspaceNotFoundError } from '@/modules/workspaces/errors/workspace'
|
||||
|
||||
const command: CommandModule<
|
||||
unknown,
|
||||
@@ -47,7 +48,9 @@ const command: CommandModule<
|
||||
)
|
||||
const workspace = await getWorkspaceBySlugOrIdFactory({ db })(args)
|
||||
if (!workspace) {
|
||||
throw new Error(`Workspace w/ slug or id '${args.workspaceSlugOrId}' not found`)
|
||||
throw new WorkspaceNotFoundError(
|
||||
`Workspace w/ slug or id '${args.workspaceSlugOrId}' not found`
|
||||
)
|
||||
}
|
||||
|
||||
await upsertPaidWorkspacePlanFactory({ db })({
|
||||
|
||||
Reference in New Issue
Block a user