debug: add error body to saveEnvironment for debugging Dokploy 400

This commit is contained in:
Z User committed 2026-10-29 12:01:05 +00:00
1 parent b3a36514d1
commit b7deb5c852
1 file changed
+13
+13
View File
@@ -191,6 +191,7 @@ export function createDokployClient(config: DokployConfig) {
const envString = Object.entries(envVars)
.map(([key, value]) => `${key}=${value}`)
.join('\n')
try {
await call('/application.saveEnvironment', {
applicationId,
env: envString,
@@ -198,6 +199,18 @@ export function createDokployClient(config: DokployConfig) {
buildSecrets: '[]',
createEnvFile: true,
})
} catch (e) {
// Re-throw with the actual error body for debugging
if (e instanceof DokployError) {
throw new DokployError(
`saveEnvironment failed: ${e.message} | body: ${JSON.stringify(e.body)?.substring(0, 300)}`,
e.status,
'/application.saveEnvironment',
e.body
)
}
throw e
}
}
async function deployApplication(applicationId: string): Promise<{ jobId?: string; status: string }> {