Skip to content

Commit

Permalink
Better Surface Cloud Error Messages (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraftp authored Oct 19, 2024
1 parent 496684a commit d7d1c8a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/dbos-cloud/applications/deploy-app-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 <database-instance-name>` to register your app and try again"));
}
Expand Down
1 change: 1 addition & 0 deletions packages/dbos-cloud/cloudutils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export interface CloudAPIErrorResponse {
message: string;
statusCode: number;
requestID: string;
DetailedError?: string;
}

export function isCloudAPIErrorResponse(obj: unknown): obj is CloudAPIErrorResponse {
Expand Down

0 comments on commit d7d1c8a

Please sign in to comment.