Skip to content

Commit b85e70a

Browse files
committed
fix: replace void operator with proper error handling in event handlers
1 parent 107035c commit b85e70a

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

src/notebooks/deepnote/integrations/integrationManager.ts

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,34 @@ export class IntegrationManager {
3232

3333
// Listen for active notebook changes to update context
3434
this.extensionContext.subscriptions.push(
35-
window.onDidChangeActiveNotebookEditor(() => void this.updateContext())
35+
window.onDidChangeActiveNotebookEditor(() =>
36+
this.updateContext().catch((err) =>
37+
logger.error('IntegrationManager: Failed to update context on notebook editor change', err)
38+
)
39+
)
3640
);
3741

3842
// Listen for notebook document changes
39-
this.extensionContext.subscriptions.push(workspace.onDidOpenNotebookDocument(() => void this.updateContext()));
43+
this.extensionContext.subscriptions.push(
44+
workspace.onDidOpenNotebookDocument(() =>
45+
this.updateContext().catch((err) =>
46+
logger.error('IntegrationManager: Failed to update context on notebook open', err)
47+
)
48+
)
49+
);
4050

41-
this.extensionContext.subscriptions.push(workspace.onDidCloseNotebookDocument(() => void this.updateContext()));
51+
this.extensionContext.subscriptions.push(
52+
workspace.onDidCloseNotebookDocument(() =>
53+
this.updateContext().catch((err) =>
54+
logger.error('IntegrationManager: Failed to update context on notebook close', err)
55+
)
56+
)
57+
);
4258

4359
// Initial context update
44-
void this.updateContext();
60+
this.updateContext().catch((err) =>
61+
logger.error('IntegrationManager: Failed to update context on activation', err)
62+
);
4563
}
4664

4765
/**

0 commit comments

Comments
 (0)