debug: add error body to saveEnvironment for debugging Dokploy 400
This commit is contained in:
1 parent
b3a36514d1
commit
b7deb5c852
1 file changed
+20
-7
+20
-7
@@ -191,13 +191,26 @@ export function createDokployClient(config: DokployConfig) {
|
|||||||
const envString = Object.entries(envVars)
|
const envString = Object.entries(envVars)
|
||||||
.map(([key, value]) => `${key}=${value}`)
|
.map(([key, value]) => `${key}=${value}`)
|
||||||
.join('\n')
|
.join('\n')
|
||||||
await call('/application.saveEnvironment', {
|
try {
|
||||||
applicationId,
|
await call('/application.saveEnvironment', {
|
||||||
env: envString,
|
applicationId,
|
||||||
buildArgs: '[]',
|
env: envString,
|
||||||
buildSecrets: '[]',
|
buildArgs: '[]',
|
||||||
createEnvFile: true,
|
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 }> {
|
async function deployApplication(applicationId: string): Promise<{ jobId?: string; status: string }> {
|
||||||
|
|||||||
Reference in new issue
Block a user