mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
chore(plugin-sql-editor): improve error message
CB-204
This commit is contained in:
@@ -124,11 +124,13 @@ export class SqlEditorNavigatorService {
|
||||
|
||||
if (data.type === SQLEditorNavigationAction.create) {
|
||||
const tabOptions = await this.createNewEditor(data.connectionId, data.catalogId, data.schemaId);
|
||||
const connectionInfo = this.connectionInfoResource.get(data.connectionId || '');
|
||||
|
||||
if (tabOptions) {
|
||||
tabInfo.openNewTab(tabOptions);
|
||||
} else {
|
||||
this.notificationService.logError({
|
||||
title: `Failed to create editor for ${data.connectionId} connection`,
|
||||
title: `Failed to create editor for ${connectionInfo?.name || data.connectionId} connection`,
|
||||
});
|
||||
}
|
||||
return;
|
||||
@@ -168,10 +170,15 @@ export class SqlEditorNavigatorService {
|
||||
connectionId = Array.from(this.connectionInfoResource.data.values())[0].id;
|
||||
}
|
||||
|
||||
const connection = await this.connectionAuthService.auth(connectionId);
|
||||
try {
|
||||
const connection = await this.connectionAuthService.auth(connectionId);
|
||||
|
||||
if (!connection?.connected) {
|
||||
return null;
|
||||
if (!connection?.connected) {
|
||||
return null;
|
||||
}
|
||||
} catch (exception) {
|
||||
this.notificationService.logException(exception);
|
||||
throw exception;
|
||||
}
|
||||
|
||||
await this.sqlDialectInfoService.loadSqlDialectInfo(connectionId);
|
||||
|
||||
@@ -112,6 +112,12 @@ export class SqlEditorTabService {
|
||||
if (!connection?.connected) {
|
||||
return false;
|
||||
}
|
||||
} catch (exception) {
|
||||
this.notificationService.logException(exception);
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
// try to create new context first
|
||||
const context = await this.createSqlContext(connectionId);
|
||||
|
||||
Reference in New Issue
Block a user