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