@@ -470,33 +470,31 @@ define([
470470
471471 var already_called_onclose = false ; // only alert once
472472 var ws_closed_early = function ( evt ) {
473+ console . log ( "WebSocket closed early" , evt ) ;
473474 if ( already_called_onclose ) {
474475 return ;
475476 }
476477 already_called_onclose = true ;
477- if ( ! evt . wasClean ) {
478- // If the websocket was closed early, that could mean
479- // that the kernel is actually dead. Try getting
480- // information about the kernel from the API call --
481- // if that fails, then assume the kernel is dead,
482- // otherwise just follow the typical websocket closed
483- // protocol.
484- that . get_info ( function ( ) {
485- that . _ws_closed ( ws_host_url , false ) ;
486- } , function ( ) {
487- that . events . trigger ( 'kernel_dead.Kernel' , { kernel : that } ) ;
488- that . _kernel_dead ( ) ;
489- } ) ;
490- }
478+ // If the websocket was closed early, that could mean
479+ // that the kernel is actually dead. Try getting
480+ // information about the kernel from the API call --
481+ // if that fails, then assume the kernel is dead,
482+ // otherwise just follow the typical websocket closed
483+ // protocol.
484+ that . get_info ( function ( ) {
485+ that . _ws_closed ( ws_host_url , false ) ;
486+ } , function ( ) {
487+ that . events . trigger ( 'kernel_dead.Kernel' , { kernel : that } ) ;
488+ that . _kernel_dead ( ) ;
489+ } ) ;
491490 } ;
492491 var ws_closed_late = function ( evt ) {
492+ console . log ( "WebSocket closed unexpectedly" , evt ) ;
493493 if ( already_called_onclose ) {
494494 return ;
495495 }
496496 already_called_onclose = true ;
497- if ( ! evt . wasClean ) {
498- that . _ws_closed ( ws_host_url , false ) ;
499- }
497+ that . _ws_closed ( ws_host_url , false ) ;
500498 } ;
501499 var ws_error = function ( evt ) {
502500 if ( already_called_onclose ) {
0 commit comments