File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -146,23 +146,28 @@ export function createJupyterConnectionInfo(
146146 const serializer : import ( '@jupyterlab/services' ) . ServerConnection . ISettings [ 'serializer' ] = {
147147 deserialize : ( data : ArrayBuffer , protocol ?: string ) => {
148148 try {
149+ if ( typeof data === 'string' ) {
150+ return deserialize ( data , '' ) ;
151+ }
149152 return deserialize ( data , protocol ) ;
150153 } catch ( ex ) {
154+ logger . warn ( `Failed to deserialize message protocol = ${ protocol } ` , ex ) ;
151155 if ( protocol ) {
152- return deserialize ( data , '' ) ;
153- } else {
154156 return deserialize ( data , supportedKernelWebSocketProtocols . v1KernelWebsocketJupyterOrg ) ;
157+ } else {
158+ return deserialize ( data , '' ) ;
155159 }
156160 }
157161 } ,
158162 serialize : ( msg : KernelMessage . IMessage , protocol ?: string ) => {
159163 try {
160164 return serialize ( msg , protocol ) ;
161165 } catch ( ex ) {
166+ logger . warn ( `Failed to serialize message protocol = ${ protocol } ` , ex ) ;
162167 if ( protocol ) {
163- return serialize ( msg , '' ) ;
164- } else {
165168 return serialize ( msg , supportedKernelWebSocketProtocols . v1KernelWebsocketJupyterOrg ) ;
169+ } else {
170+ return serialize ( msg , '' ) ;
166171 }
167172 }
168173 }
You can’t perform that action at this time.
0 commit comments