Skip to content

Commit 2c11eee

Browse files
committed
fix #7692 -- jupyter/format: comm timeout results in internal error
1 parent ac6d461 commit 2c11eee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/packages/frontend/jupyter/browser-actions.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,12 @@ export class JupyterActions extends JupyterActions0 {
237237
try {
238238
resp = await this.api_call_formatter(code, config);
239239
} catch (err) {
240-
err.formatInput = code;
240+
try {
241+
err.formatInput = code;
242+
} catch (_err) {
243+
// it's possible that err = 'timeout', which is a string, and then the above fails.
244+
// to see this, disconnect your laptop from the internet then try to format a cell.
245+
}
241246
throw err;
242247
}
243248
resp = parsing.process_magics(resp, config.syntax, "unescape");

0 commit comments

Comments
 (0)