Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xxadev
vscode
提交
7410a0ea
V
vscode
项目概览
xxadev
/
vscode
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7410a0ea
编写于
2月 12, 2018
作者:
B
Benjamin Pasero
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
address #43228 for insiders
上级
9a4ba7d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
30 addition
and
21 deletion
+30
-21
src/vs/code/electron-main/app.ts
src/vs/code/electron-main/app.ts
+24
-20
src/vs/code/electron-main/main.ts
src/vs/code/electron-main/main.ts
+6
-1
未找到文件。
src/vs/code/electron-main/app.ts
浏览文件 @
7410a0ea
...
...
@@ -58,6 +58,7 @@ import { IIssueService } from 'vs/platform/issue/common/issue';
import
{
IssueChannel
}
from
'
vs/platform/issue/common/issueIpc
'
;
import
{
IssueService
}
from
'
vs/platform/issue/electron-main/issueService
'
;
import
{
LogLevelSetterChannel
}
from
'
vs/platform/log/common/logIpc
'
;
import
{
setUnexpectedErrorHandler
}
from
'
vs/base/common/errors
'
;
export
class
CodeApplication
{
...
...
@@ -90,26 +91,8 @@ export class CodeApplication {
private
registerListeners
():
void
{
// We handle uncaught exceptions here to prevent electron from opening a dialog to the user
process
.
on
(
'
uncaughtException
'
,
(
err
:
any
)
=>
{
if
(
err
)
{
// take only the message and stack property
const
friendlyError
=
{
message
:
err
.
message
,
stack
:
err
.
stack
};
// handle on client side
if
(
this
.
windowsMainService
)
{
this
.
windowsMainService
.
sendToFocused
(
'
vscode:reportError
'
,
JSON
.
stringify
(
friendlyError
));
}
}
this
.
logService
.
error
(
`[uncaught exception in main]:
${
err
}
`
);
if
(
err
.
stack
)
{
this
.
logService
.
error
(
err
.
stack
);
}
});
setUnexpectedErrorHandler
(
err
=>
this
.
onUnexpectedError
(
err
));
process
.
on
(
'
uncaughtException
'
,
err
=>
this
.
onUnexpectedError
(
err
));
app
.
on
(
'
will-quit
'
,
()
=>
{
this
.
logService
.
trace
(
'
App#will-quit: disposing resources
'
);
...
...
@@ -240,6 +223,27 @@ export class CodeApplication {
});
}
private
onUnexpectedError
(
err
:
Error
):
void
{
if
(
err
)
{
// take only the message and stack property
const
friendlyError
=
{
message
:
err
.
message
,
stack
:
err
.
stack
};
// handle on client side
if
(
this
.
windowsMainService
)
{
this
.
windowsMainService
.
sendToFocused
(
'
vscode:reportError
'
,
JSON
.
stringify
(
friendlyError
));
}
}
this
.
logService
.
error
(
`[uncaught exception in main]:
${
err
}
`
);
if
(
err
.
stack
)
{
this
.
logService
.
error
(
err
.
stack
);
}
}
private
onBroadcast
(
event
:
string
,
payload
:
any
):
void
{
// Theme changes
...
...
src/vs/code/electron-main/main.ts
浏览文件 @
7410a0ea
...
...
@@ -49,6 +49,7 @@ import { BufferLogService } from 'vs/platform/log/common/bufferLog';
import
{
uploadLogs
}
from
'
vs/code/electron-main/logUploader
'
;
import
{
IChoiceService
}
from
'
vs/platform/message/common/message
'
;
import
{
ChoiceCliService
}
from
'
vs/platform/message/node/messageCli
'
;
import
{
setUnexpectedErrorHandler
}
from
'
vs/base/common/errors
'
;
function
createServices
(
args
:
ParsedArgs
,
bufferLogService
:
BufferLogService
):
IInstantiationService
{
const
services
=
new
ServiceCollection
();
...
...
@@ -290,8 +291,12 @@ function quit(accessor: ServicesAccessor, reason?: ExpectedError | Error): void
}
function
main
()
{
let
args
:
ParsedArgs
;
// Set the error handler early enough so that we are not getting the
// default electron error dialog popping up
setUnexpectedErrorHandler
(
err
=>
console
.
error
(
err
));
let
args
:
ParsedArgs
;
try
{
args
=
parseMainProcessArgv
(
process
.
argv
);
args
=
validatePaths
(
args
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录