mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 11:38:51 +01:00
remove TPromise from ipc.net
This commit is contained in:
@@ -145,11 +145,11 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
|
||||
});
|
||||
}
|
||||
|
||||
function setupIPC(hook: string): TPromise<Server> {
|
||||
function setup(retry: boolean): TPromise<Server> {
|
||||
function setupIPC(hook: string): Thenable<Server> {
|
||||
function setup(retry: boolean): Thenable<Server> {
|
||||
return serve(hook).then(null, err => {
|
||||
if (!retry || platform.isWindows || err.code !== 'EADDRINUSE') {
|
||||
return TPromise.wrapError(err);
|
||||
return Promise.reject(err);
|
||||
}
|
||||
|
||||
// should retry, not windows and eaddrinuse
|
||||
@@ -158,7 +158,7 @@ function setupIPC(hook: string): TPromise<Server> {
|
||||
client => {
|
||||
// we could connect to a running instance. this is not good, abort
|
||||
client.dispose();
|
||||
return TPromise.wrapError(new Error('There is an instance already running.'));
|
||||
return Promise.reject(new Error('There is an instance already running.'));
|
||||
},
|
||||
err => {
|
||||
// it happens on Linux and OS X that the pipe is left behind
|
||||
@@ -167,7 +167,7 @@ function setupIPC(hook: string): TPromise<Server> {
|
||||
try {
|
||||
fs.unlinkSync(hook);
|
||||
} catch (e) {
|
||||
return TPromise.wrapError(new Error('Error deleting the shared ipc hook.'));
|
||||
return Promise.reject(new Error('Error deleting the shared ipc hook.'));
|
||||
}
|
||||
|
||||
return setup(false);
|
||||
|
||||
Reference in New Issue
Block a user