Skip to content

Commit

Permalink
fix: register error handler in workbench
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Oct 17, 2024
1 parent 6614a05 commit bdc5bf9
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 33 deletions.
5 changes: 3 additions & 2 deletions src/service-override/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editor
import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service'
import { EditorService } from 'vs/workbench/services/editor/browser/editorService'
import { EditorParts } from 'vs/workbench/browser/parts/editor/editorParts'
import { onUnexpectedError } from 'vs/base/common/errors'
import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors'
import { BrowserWindow } from 'vs/workbench/browser/window'
import { detectFullscreen } from 'vs/base/browser/dom'
import { mainWindow } from 'vs/base/browser/window'
Expand All @@ -35,8 +35,9 @@ class CustomWorkbench extends Workbench {
this.mainContainer.classList.add('monaco-workbench-part')
}

protected override registerErrorHandler(): void {
protected override registerErrorHandler(logService: ILogService): void {
// prevent intercepting global error events
setUnexpectedErrorHandler((error) => this.handleUnexpectedError(error, logService))
}

override createNotificationsHandlers() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@ Date: Mon, 11 Mar 2024 17:32:31 +0100
Subject: [PATCH] feat: export some classes and make some methods accessible

---
.../actions/browser/actionViewItemService.ts | 2 +-
.../browser/extensionResourceLoaderService.ts | 2 +-
.../workbench/api/browser/statusBarExtensionPoint.ts | 2 +-
src/vs/workbench/browser/layout.ts | 10 +++++-----
src/vs/workbench/browser/workbench.ts | 12 ++++++------
.../debug/browser/extensionHostDebugService.ts | 2 +-
.../contrib/issue/browser/issueTroubleshoot.ts | 6 +++---
.../contrib/logs/common/defaultLogLevels.ts | 2 +-
.../dialogs/browser/abstractFileDialogService.ts | 2 +-
.../services/dialogs/browser/fileDialogService.ts | 4 ++--
.../extensionManagement/browser/extensionBisect.ts | 2 +-
.../common/extensionFeaturesManagemetService.ts | 2 +-
.../services/extensions/browser/extensionService.ts | 6 +++---
.../extensions/browser/extensionUrlHandler.ts | 2 +-
.../extensions/browser/webWorkerExtensionHost.ts | 2 +-
.../extensions/common/abstractExtensionService.ts | 10 +++++-----
.../services/keybinding/browser/keybindingService.ts | 2 +-
.../languageStatus/common/languageStatusService.ts | 2 +-
.../services/localization/browser/localeService.ts | 2 +-
.../services/outline/browser/outlineService.ts | 2 +-
.../workbench/services/path/browser/pathService.ts | 2 +-
.../services/remote/common/remoteExplorerService.ts | 2 +-
.../remote/common/remoteExtensionsScanner.ts | 2 +-
.../terminal/common/embedderTerminalService.ts | 2 +-
.../userDataProfile/common/remoteUserDataProfiles.ts | 2 +-
.../services/userDataSync/common/userDataSyncUtil.ts | 2 +-
26 files changed, 44 insertions(+), 44 deletions(-)
.../actions/browser/actionViewItemService.ts | 2 +-
.../browser/extensionResourceLoaderService.ts | 2 +-
.../api/browser/statusBarExtensionPoint.ts | 2 +-
src/vs/workbench/browser/layout.ts | 10 +++++-----
src/vs/workbench/browser/workbench.ts | 14 +++++++-------
.../debug/browser/extensionHostDebugService.ts | 2 +-
.../contrib/issue/browser/issueTroubleshoot.ts | 6 +++---
.../contrib/logs/common/defaultLogLevels.ts | 2 +-
.../dialogs/browser/abstractFileDialogService.ts | 2 +-
.../services/dialogs/browser/fileDialogService.ts | 4 ++--
.../extensionManagement/browser/extensionBisect.ts | 2 +-
.../common/extensionFeaturesManagemetService.ts | 2 +-
.../extensions/browser/extensionService.ts | 6 +++---
.../extensions/browser/extensionUrlHandler.ts | 2 +-
.../extensions/browser/webWorkerExtensionHost.ts | 2 +-
.../extensions/common/abstractExtensionService.ts | 10 +++++-----
.../keybinding/browser/keybindingService.ts | 2 +-
.../languageStatus/common/languageStatusService.ts | 2 +-
.../services/localization/browser/localeService.ts | 2 +-
.../services/outline/browser/outlineService.ts | 2 +-
.../workbench/services/path/browser/pathService.ts | 2 +-
.../remote/common/remoteExplorerService.ts | 2 +-
.../remote/common/remoteExtensionsScanner.ts | 2 +-
.../terminal/common/embedderTerminalService.ts | 2 +-
.../common/remoteUserDataProfiles.ts | 2 +-
.../userDataSync/common/userDataSyncUtil.ts | 2 +-
26 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/src/vs/platform/actions/browser/actionViewItemService.ts b/src/vs/platform/actions/browser/actionViewItemService.ts
index fa5739eec65..07f413b305f 100644
Expand Down Expand Up @@ -114,7 +114,7 @@ index 7290a2f7076..2e07af10fae 100644
readonly filesToDiff?: IPathToOpen[];
readonly filesToMerge?: IPathToOpen[];
diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts
index f081430e49f..46172e06143 100644
index f081430e49f..cf237f2df62 100644
--- a/src/vs/workbench/browser/workbench.ts
+++ b/src/vs/workbench/browser/workbench.ts
@@ -82,7 +82,7 @@ export class Workbench extends Layout {
Expand All @@ -126,6 +126,15 @@ index f081430e49f..46172e06143 100644

// Listen on unhandled rejection events
// Note: intentionally not registered as disposable to handle
@@ -126,7 +126,7 @@ export class Workbench extends Layout {
}

private previousUnexpectedError: { message: string | undefined; time: number } = { message: undefined, time: 0 };
- private handleUnexpectedError(error: unknown, logService: ILogService): void {
+ protected handleUnexpectedError(error: unknown, logService: ILogService): void {
const message = toErrorMessage(error, true);
if (!message) {
return;
@@ -201,7 +201,7 @@ export class Workbench extends Layout {
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subject: [PATCH] cleanup: remove code that we will run ourselves
1 file changed, 20 deletions(-)

diff --git a/src/vs/workbench/browser/workbench.ts b/src/vs/workbench/browser/workbench.ts
index 46172e06143..317aa021d22 100644
index cf237f2df62..ca295f38ddb 100644
--- a/src/vs/workbench/browser/workbench.ts
+++ b/src/vs/workbench/browser/workbench.ts
@@ -11,10 +11,7 @@ import { RunOnceScheduler, timeout } from '../../base/common/async.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Subject: [PATCH] fix: rollback typescript as the last version breaks the
3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index a849e69a098..88d0ca5061b 100644
index 7b029961668..b0904ba0f51 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -154,7 +154,7 @@
Expand All @@ -37,7 +37,7 @@ index a849e69a098..88d0ca5061b 100644
"bin": {
"tsc": "bin/tsc",
diff --git a/package.json b/package.json
index 51fb981850e..446627d4f3a 100644
index 7e0de1810c6..ff1e24a30ba 100644
--- a/package.json
+++ b/package.json
@@ -216,7 +216,7 @@
Expand Down

0 comments on commit bdc5bf9

Please sign in to comment.