@@ -155,7 +155,7 @@ export default class ConnectionController {
155
155
} catch ( error ) {
156
156
// Here we're lenient when loading connections in case their
157
157
// connections have become corrupted.
158
- log . error ( `Connection migration failed: ${ formatError ( error ) . message } ` ) ;
158
+ log . error ( 'Migrating previously saved connections failed' , error ) ;
159
159
return ;
160
160
}
161
161
}
@@ -164,7 +164,7 @@ export default class ConnectionController {
164
164
// Return saved connection as it is.
165
165
if ( ! ext . keytarModule ) {
166
166
log . error (
167
- 'Load saved connections failed: VSCode extension keytar module is undefined. '
167
+ 'Getting connection info with secrets failed because VSCode extension keytar module is undefined'
168
168
) ;
169
169
return savedConnectionInfo as StoreConnectionInfoWithConnectionOptions ;
170
170
}
@@ -197,9 +197,7 @@ export default class ConnectionController {
197
197
} catch ( error ) {
198
198
// Here we're lenient when loading connections in case their
199
199
// connections have become corrupted.
200
- log . error (
201
- `Merging connection with secrets failed: ${ formatError ( error ) . message } `
202
- ) ;
200
+ log . error ( 'Getting connection info with secrets failed' , error ) ;
203
201
return ;
204
202
}
205
203
}
@@ -301,7 +299,7 @@ export default class ConnectionController {
301
299
async addNewConnectionStringAndConnect (
302
300
connectionString : string
303
301
) : Promise < boolean > {
304
- log . info ( 'Trying to connect to a new connection configuration' ) ;
302
+ log . info ( 'Trying to connect to a new connection configuration... ' ) ;
305
303
306
304
const connectionStringData = new ConnectionString ( connectionString ) ;
307
305
@@ -313,7 +311,7 @@ export default class ConnectionController {
313
311
) ;
314
312
315
313
try {
316
- const connectResult = await this . saveNewConnectionAndConnect (
314
+ const connectResult = await this . saveNewConnectionFromFormAndConnect (
317
315
{
318
316
id : uuidv4 ( ) ,
319
317
connectionOptions : {
@@ -326,11 +324,10 @@ export default class ConnectionController {
326
324
return connectResult . successfullyConnected ;
327
325
} catch ( error ) {
328
326
const printableError = formatError ( error ) ;
329
- log . error ( 'Failed to connect' , printableError ) ;
327
+ log . error ( 'Failed to connect with a connection string ' , error ) ;
330
328
void vscode . window . showErrorMessage (
331
329
`Unable to connect: ${ printableError . message } `
332
330
) ;
333
-
334
331
return false ;
335
332
}
336
333
}
@@ -391,7 +388,7 @@ export default class ConnectionController {
391
388
return savedConnectionInfo ;
392
389
}
393
390
394
- async saveNewConnectionAndConnect (
391
+ async saveNewConnectionFromFormAndConnect (
395
392
originalConnectionInfo : ConnectionInfo ,
396
393
connectionType : ConnectionTypes
397
394
) : Promise < ConnectionAttemptResult > {
@@ -412,9 +409,7 @@ export default class ConnectionController {
412
409
connectionOptions : originalConnectionInfo . connectionOptions , // The connection options with secrets.
413
410
} ;
414
411
415
- log . info (
416
- `Connect called to connect to instance: ${ savedConnectionInfo . name } `
417
- ) ;
412
+ log . info ( 'Connect called to connect to instance' , savedConnectionInfo . name ) ;
418
413
419
414
return this . _connect ( savedConnectionInfo . id , connectionType ) ;
420
415
}
@@ -539,19 +534,18 @@ export default class ConnectionController {
539
534
540
535
return true ;
541
536
} catch ( error ) {
537
+ log . error ( 'Failed to connect by a connection id' , error ) ;
542
538
const printableError = formatError ( error ) ;
543
- log . error ( 'Failed to connect' , printableError ) ;
544
539
void vscode . window . showErrorMessage (
545
540
`Unable to connect: ${ printableError . message } `
546
541
) ;
547
-
548
542
return false ;
549
543
}
550
544
}
551
545
552
546
async disconnect ( ) : Promise < boolean > {
553
547
log . info (
554
- 'Disconnect called, currently connected to: ' ,
548
+ 'Disconnect called, currently connected to' ,
555
549
this . _currentConnectionId
556
550
) ;
557
551
0 commit comments