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

Throw diagnostics error if available for sql to model #1138

Merged
merged 1 commit into from
May 17, 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
3 changes: 3 additions & 0 deletions src/commands/sqlToModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class SqlToModel {
}
const event = this.eventMap.get(project.projectRoot.fsPath);
if (!event) {
project.throwDiagnosticsErrorIfAvailable();
// If we get here, we don't know what exactly is the error.
// Probably the extension is still initializing
window.showErrorMessage(
extendErrorWithSupportLinks(
"The extension is still initializing, please retry again.",
Expand Down
4 changes: 4 additions & 0 deletions src/dbt_client/dbtCloudIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -977,4 +977,8 @@ export class DBTCloudProjectIntegration
}

async applyDeferConfig(): Promise<void> {}

throwDiagnosticsErrorIfAvailable(): void {
this.throwBridgeErrorIfAvailable();
}
}
4 changes: 4 additions & 0 deletions src/dbt_client/dbtCoreIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1079,4 +1079,8 @@ export class DBTCoreProjectIntegration
);
await this.rebuildManifest();
}

throwDiagnosticsErrorIfAvailable(): void {
this.throwBridgeErrorIfAvailable();
}
}
1 change: 1 addition & 0 deletions src/dbt_client/dbtIntegration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ export interface DBTProjectIntegration extends Disposable {
): Promise<ProjectHealthcheck>;
applyDeferConfig(): Promise<void>;
getAllDiagnostic(): Diagnostic[];
throwDiagnosticsErrorIfAvailable(): void;
getPythonBridgeStatus(): boolean;
}

Expand Down
4 changes: 4 additions & 0 deletions src/manifest/dbtProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1120,4 +1120,8 @@ select * from renamed
async applyDeferConfig(): Promise<void> {
await this.dbtProjectIntegration.applyDeferConfig();
}

throwDiagnosticsErrorIfAvailable() {
this.dbtProjectIntegration.throwDiagnosticsErrorIfAvailable();
}
}
Loading