Skip to content

Commit

Permalink
fix: backend error messages and dbt cloud adapterType (#1519)
Browse files Browse the repository at this point in the history
* fix: backend error messages

* fix: dbt cloud adapterType

* WIP

---------

Co-authored-by: Michiel De Smet <[email protected]>
  • Loading branch information
AdiGajbhiye and mdesmet authored Dec 11, 2024
1 parent 99a09f7 commit 65d0173
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/altimate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,12 @@ export class AltimateRequest {
status: response.status,
textResponse,
});
let jsonResponse: any;
try {
jsonResponse = JSON.parse(textResponse);
} catch {}
throw new APIError(
`Could not process request, server responded with ${response.status}: ${textResponse}`,
`Could not process request, server responded with ${response.status}: ${jsonResponse?.detail || textResponse}`,
);
} catch (e) {
this.dbtTerminal.error("apiCatchAllError", "catchAllError", e, true, {
Expand Down
2 changes: 1 addition & 1 deletion src/dbt_client/dbtCloudIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export class DBTCloudProjectIntegration
} else {
this.initializePaths();
}
if (!this.adapterType) {
if (this.adapterType === "unknown") {
// We only fetch the adapter type once, as it may impact compilation preview otherwise
await this.findAdapterType();
}
Expand Down

0 comments on commit 65d0173

Please sign in to comment.