🔊 (customDomain) Add debug log for custom domains req…
This commit is contained in:
@ -65,6 +65,7 @@ export const createCustomDomain = authenticatedProcedure
|
||||
throw new TRPCError({
|
||||
code: 'INTERNAL_SERVER_ERROR',
|
||||
message: 'Failed to create custom domain on Vercel',
|
||||
cause: await err.response.text(),
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -2,7 +2,7 @@ import prisma from '@typebot.io/lib/prisma'
|
||||
import { authenticatedProcedure } from '@/helpers/server/trpc'
|
||||
import { TRPCError } from '@trpc/server'
|
||||
import { z } from 'zod'
|
||||
import ky from 'ky'
|
||||
import ky, { HTTPError } from 'ky'
|
||||
import { env } from '@typebot.io/env'
|
||||
import { isWriteWorkspaceForbidden } from '@/features/workspace/helpers/isWriteWorkspaceForbidden'
|
||||
|
||||
@ -47,10 +47,17 @@ export const deleteCustomDomain = authenticatedProcedure
|
||||
await deleteDomainOnVercel(name)
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
throw new TRPCError({
|
||||
code: 'INTERNAL_SERVER_ERROR',
|
||||
message: 'Failed to delete domain on Vercel',
|
||||
})
|
||||
if (error instanceof HTTPError)
|
||||
throw new TRPCError({
|
||||
code: 'INTERNAL_SERVER_ERROR',
|
||||
message: 'Failed to delete domain on Vercel',
|
||||
cause: await error.response.text(),
|
||||
})
|
||||
else
|
||||
throw new TRPCError({
|
||||
code: 'INTERNAL_SERVER_ERROR',
|
||||
message: 'Failed to delete domain on Vercel',
|
||||
})
|
||||
}
|
||||
await prisma.customDomain.deleteMany({
|
||||
where: {
|
||||
|
Reference in New Issue
Block a user