@@ -155,7 +155,7 @@ export default class ConnectionController {
155155 } catch ( error ) {
156156 // Here we're lenient when loading connections in case their
157157 // connections have become corrupted.
158- log . error ( `Connection migration failed: ${ formatError ( error ) . message } ` ) ;
158+ log . error ( 'Migrating previously saved connections failed' , error ) ;
159159 return ;
160160 }
161161 }
@@ -164,7 +164,7 @@ export default class ConnectionController {
164164 // Return saved connection as it is.
165165 if ( ! ext . keytarModule ) {
166166 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'
168168 ) ;
169169 return savedConnectionInfo as StoreConnectionInfoWithConnectionOptions ;
170170 }
@@ -197,9 +197,7 @@ export default class ConnectionController {
197197 } catch ( error ) {
198198 // Here we're lenient when loading connections in case their
199199 // 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 ) ;
203201 return ;
204202 }
205203 }
@@ -301,7 +299,7 @@ export default class ConnectionController {
301299 async addNewConnectionStringAndConnect (
302300 connectionString : string
303301 ) : Promise < boolean > {
304- log . info ( 'Trying to connect to a new connection configuration' ) ;
302+ log . info ( 'Trying to connect to a new connection configuration... ' ) ;
305303
306304 const connectionStringData = new ConnectionString ( connectionString ) ;
307305
@@ -313,7 +311,7 @@ export default class ConnectionController {
313311 ) ;
314312
315313 try {
316- const connectResult = await this . saveNewConnectionAndConnect (
314+ const connectResult = await this . saveNewConnectionFromFormAndConnect (
317315 {
318316 id : uuidv4 ( ) ,
319317 connectionOptions : {
@@ -326,11 +324,10 @@ export default class ConnectionController {
326324 return connectResult . successfullyConnected ;
327325 } catch ( error ) {
328326 const printableError = formatError ( error ) ;
329- log . error ( 'Failed to connect' , printableError ) ;
327+ log . error ( 'Failed to connect with a connection string ' , error ) ;
330328 void vscode . window . showErrorMessage (
331329 `Unable to connect: ${ printableError . message } `
332330 ) ;
333-
334331 return false ;
335332 }
336333 }
@@ -391,7 +388,7 @@ export default class ConnectionController {
391388 return savedConnectionInfo ;
392389 }
393390
394- async saveNewConnectionAndConnect (
391+ async saveNewConnectionFromFormAndConnect (
395392 originalConnectionInfo : ConnectionInfo ,
396393 connectionType : ConnectionTypes
397394 ) : Promise < ConnectionAttemptResult > {
@@ -412,9 +409,7 @@ export default class ConnectionController {
412409 connectionOptions : originalConnectionInfo . connectionOptions , // The connection options with secrets.
413410 } ;
414411
415- log . info (
416- `Connect called to connect to instance: ${ savedConnectionInfo . name } `
417- ) ;
412+ log . info ( 'Connect called to connect to instance' , savedConnectionInfo . name ) ;
418413
419414 return this . _connect ( savedConnectionInfo . id , connectionType ) ;
420415 }
@@ -539,19 +534,18 @@ export default class ConnectionController {
539534
540535 return true ;
541536 } catch ( error ) {
537+ log . error ( 'Failed to connect by a connection id' , error ) ;
542538 const printableError = formatError ( error ) ;
543- log . error ( 'Failed to connect' , printableError ) ;
544539 void vscode . window . showErrorMessage (
545540 `Unable to connect: ${ printableError . message } `
546541 ) ;
547-
548542 return false ;
549543 }
550544 }
551545
552546 async disconnect ( ) : Promise < boolean > {
553547 log . info (
554- 'Disconnect called, currently connected to: ' ,
548+ 'Disconnect called, currently connected to' ,
555549 this . _currentConnectionId
556550 ) ;
557551
0 commit comments