@@ -213,6 +213,7 @@ class MATLABKernel(ipykernel.kernelbase.Kernel):
213
213
}
214
214
215
215
# MATLAB Kernel state
216
+ murl = ""
216
217
is_matlab_licensed : bool = False
217
218
matlab_status = ""
218
219
matlab_proxy_has_error : bool = False
@@ -359,7 +360,9 @@ def do_complete(self, code, cursor_pos):
359
360
completion_results = mwi_comm_helpers .send_completion_request_to_matlab (
360
361
self .murl , self .headers , code , cursor_pos
361
362
)
362
- except HTTPError as e :
363
+ except (MATLABConnectionError , HTTPError ):
364
+ # Jupyter doesn't show the error messages to the user for this request.
365
+ # Hence, we'll currently do nothing when an error occurs here.
363
366
pass
364
367
365
368
return {
@@ -399,9 +402,15 @@ def do_history(
399
402
)
400
403
401
404
def do_shutdown (self , restart ):
402
- mwi_comm_helpers .send_shutdown_request_to_matlab (
403
- self .murl , self .headers , self .ident
404
- )
405
+ try :
406
+ mwi_comm_helpers .send_shutdown_request_to_matlab (
407
+ self .murl , self .headers , self .ident
408
+ )
409
+ except (MATLABConnectionError , HTTPError ):
410
+ # Jupyter doesn't show the error messages to the user for this request.
411
+ # Hence, we'll currently do nothing when an error occurs here.
412
+ pass
413
+
405
414
return super ().do_shutdown (restart )
406
415
407
416
# Helper functions
0 commit comments