From d7d1c8a55e4fb3bed1f84b1ce9634ada427fc876 Mon Sep 17 00:00:00 2001 From: Peter Kraft Date: Fri, 18 Oct 2024 17:38:11 -0700 Subject: [PATCH] Better Surface Cloud Error Messages (#650) --- packages/dbos-cloud/applications/deploy-app-code.ts | 3 +++ packages/dbos-cloud/cloudutils.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/packages/dbos-cloud/applications/deploy-app-code.ts b/packages/dbos-cloud/applications/deploy-app-code.ts index 1678a791..c510facc 100644 --- a/packages/dbos-cloud/applications/deploy-app-code.ts +++ b/packages/dbos-cloud/applications/deploy-app-code.ts @@ -240,6 +240,9 @@ export async function deployAppCode( if (isCloudAPIErrorResponse(axiosError.response?.data)) { handleAPIErrors(errorLabel, axiosError); const resp: CloudAPIErrorResponse = axiosError.response?.data; + if (resp.DetailedError) { + logger.error(resp.DetailedError) + } if (resp.message.includes(`application ${appName} not found`)) { console.log(chalk.red("Did you register this application? Hint: run `dbos-cloud app register -d ` to register your app and try again")); } diff --git a/packages/dbos-cloud/cloudutils.ts b/packages/dbos-cloud/cloudutils.ts index 7a769cbc..eccdfa29 100644 --- a/packages/dbos-cloud/cloudutils.ts +++ b/packages/dbos-cloud/cloudutils.ts @@ -138,6 +138,7 @@ export interface CloudAPIErrorResponse { message: string; statusCode: number; requestID: string; + DetailedError?: string; } export function isCloudAPIErrorResponse(obj: unknown): obj is CloudAPIErrorResponse {