@@ -73,14 +73,13 @@ export class TlsSocketTransport implements ConnectionTransport {
7373 this . socket = tls . connect ( this . config . port as number , this . config . host , this . config . tlsOptions , ( ) => {
7474 if ( ! this . socket ?. authorized ) {
7575 const anonimizedError = anonimizeError ( ( this . socket as TLSSocket ) . authorizationError )
76- console . debug ( 'Connection was not authorized' , anonimizedError )
76+ console . error ( 'Connection was not authorized' , anonimizedError )
7777 this . close ( )
7878 finish ( new SQLiteCloudError ( 'Connection was not authorized' , { cause : anonimizedError } ) )
7979 } else {
8080 // the connection was closed before it was even opened,
8181 // eg. client closed the connection before the server accepted it
8282 if ( this . socket === null ) {
83- console . debug ( 'Connection was closed before it was opened' )
8483 finish ( new SQLiteCloudError ( 'Connection was closed before it was done opening' ) )
8584 return
8685 }
@@ -102,13 +101,12 @@ export class TlsSocketTransport implements ConnectionTransport {
102101 } )
103102
104103 this . socket . on ( 'close' , ( ) => {
105- console . debug ( 'Connection closed' )
106104 this . socket = null
107105 finish ( new SQLiteCloudError ( 'Connection was closed' ) )
108106 } )
109107
110108 this . socket . once ( 'error' , ( error : any ) => {
111- console . debug ( 'Connection error' , error )
109+ console . error ( 'Connection error' , error )
112110 finish ( new SQLiteCloudError ( 'Connection error' , { cause : error } ) )
113111 } )
114112
@@ -129,7 +127,6 @@ export class TlsSocketTransport implements ConnectionTransport {
129127 let buffer = Buffer . alloc ( 0 )
130128 const rowsetChunks : Buffer [ ] = [ ]
131129 const startedOn = new Date ( )
132- console . debug ( `Send: ${ commands } ` )
133130
134131 // define what to do if an answer does not arrive within the set timeout
135132 let socketTimeout : number
@@ -166,7 +163,7 @@ export class TlsSocketTransport implements ConnectionTransport {
166163 bufferString = bufferString . substring ( 0 , 100 ) + '...' + bufferString . substring ( bufferString . length - 40 )
167164 }
168165 const elapsedMs = new Date ( ) . getTime ( ) - startedOn . getTime ( )
169- console . debug ( `Receive: ${ bufferString } - ${ elapsedMs } ms` )
166+ // console.debug(`Receive: ${bufferString} - ${elapsedMs}ms`)
170167 }
171168
172169 // need to decompress this buffer before decoding?
@@ -189,7 +186,6 @@ export class TlsSocketTransport implements ConnectionTransport {
189186 rowsetChunks . push ( buffer )
190187 buffer = Buffer . alloc ( 0 )
191188 const okCommand = formatCommand ( 'OK' )
192- console . debug ( `Send: ${ okCommand } ` )
193189 this . socket ?. write ( okCommand )
194190 }
195191 }
@@ -217,14 +213,14 @@ export class TlsSocketTransport implements ConnectionTransport {
217213 this . socket ?. write ( commands , 'utf8' , ( ) => {
218214 socketTimeout = setTimeout ( ( ) => {
219215 const timeoutError = new SQLiteCloudError ( 'Request timed out' , { cause : anonimizeCommand ( commands ) } )
220- console . debug ( `Request timed out, config.timeout is ${ this . config ?. timeout as number } ms` , timeoutError )
216+ // console.debug(`Request timed out, config.timeout is ${this.config?.timeout as number}ms`, timeoutError)
221217 finish ( timeoutError )
222218 } , this . config ?. timeout )
223219 this . socket ?. on ( 'data' , readData )
224220 } )
225221
226222 this . socket ?. once ( 'error' , ( error : any ) => {
227- console . debug ( 'Socket error' , error )
223+ console . error ( 'Socket error' , error )
228224 this . close ( )
229225 finish ( new SQLiteCloudError ( 'Socket error' , { cause : anonimizeError ( error ) } ) )
230226 } )
0 commit comments