Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: backend error messages and dbt cloud adapterType #1519

Merged
merged 4 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}`,
mdesmet marked this conversation as resolved.
Show resolved Hide resolved
);
} 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
Loading