|
1 | | -# Copyright 2024 The MathWorks, Inc. |
| 1 | +# Copyright 2024-2025 The MathWorks, Inc. |
2 | 2 |
|
3 | 3 | """This module contains derived class implementation of MATLABKernel that uses |
4 | 4 | MATLAB Proxy Manager to manage interactions with matlab-proxy & MATLAB. |
@@ -93,7 +93,7 @@ async def do_shutdown(self, restart): |
93 | 93 | async def perform_startup_checks(self): |
94 | 94 | """Overriding base function to provide a different iframe source""" |
95 | 95 | await super().perform_startup_checks( |
96 | | - self.jupyter_base_url, f'{self.matlab_proxy_base_url.lstrip("/")}/' |
| 96 | + self.jupyter_base_url, f"{self.matlab_proxy_base_url.lstrip('/')}/" |
97 | 97 | ) |
98 | 98 |
|
99 | 99 | # Helper functions |
@@ -139,19 +139,23 @@ async def _initialize_matlab_proxy_with_mpm(self, _logger: Logger): |
139 | 139 | parent_id=self.parent_pid, |
140 | 140 | is_shared_matlab=True, |
141 | 141 | ) |
| 142 | + err = response.get("errors") |
| 143 | + if err: |
| 144 | + raise MATLABConnectionError(err) |
142 | 145 | return ( |
143 | 146 | response.get("absolute_url"), |
144 | 147 | response.get("mwi_base_url"), |
145 | 148 | response.get("headers"), |
146 | 149 | response.get("mpm_auth_token"), |
147 | 150 | ) |
148 | 151 | except Exception as e: |
149 | | - _logger.error( |
150 | | - f"MATLAB Kernel could not start matlab-proxy using proxy manager with error: {e}" |
151 | | - ) |
| 152 | + _logger.error(f"MATLAB Kernel could not start matlab-proxy, Reason: {e}") |
152 | 153 | raise MATLABConnectionError( |
153 | | - """ |
154 | | - Error: MATLAB Kernel could not start the MATLAB proxy process via proxy manager. |
| 154 | + f""" |
| 155 | + Error: MATLAB Kernel could not start the MATLAB proxy process. |
| 156 | + Reason: {e} |
| 157 | + Resolution: Run the troubleshooting script described in the file `troubleshooting.md`. |
| 158 | + If the issue persists, create an issue on Github: https://github.com/mathworks/jupyter-matlab-proxy/issues. |
155 | 159 | """ |
156 | 160 | ) from e |
157 | 161 |
|
|
0 commit comments