Skip to content

Commit 1439f53

Browse files
committed
💄 improve logging, make sure to continue throwing if the remote authority doesn't contain a '+' and is not in a 'hostname:port' format
1 parent 0029cab commit 1439f53

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

src/vs/workbench/services/extensions/electron-sandbox/nativeExtensionService.ts

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -277,22 +277,18 @@ export class NativeExtensionService extends AbstractExtensionService implements
277277
const authorityPlusIndex = remoteAuthority.indexOf('+');
278278
if (authorityPlusIndex === -1) {
279279
// This authority does not need to be resolved, simply parse the port number
280-
try {
281-
const { host, port } = parseAuthorityWithPort(remoteAuthority);
282-
return {
283-
authority: {
284-
authority: remoteAuthority,
285-
connectTo: {
286-
type: RemoteConnectionType.WebSocket,
287-
host,
288-
port
289-
},
290-
connectionToken: undefined
291-
}
292-
};
293-
} catch {
294-
// continue
295-
}
280+
const { host, port } = parseAuthorityWithPort(remoteAuthority);
281+
return {
282+
authority: {
283+
authority: remoteAuthority,
284+
connectTo: {
285+
type: RemoteConnectionType.WebSocket,
286+
host,
287+
port
288+
},
289+
connectionToken: undefined
290+
}
291+
};
296292
}
297293

298294
const localProcessExtensionHosts = this._getExtensionHostManagers(ExtensionHostKind.LocalProcess);
@@ -398,7 +394,7 @@ export class NativeExtensionService extends AbstractExtensionService implements
398394
performance.mark(`code/willResolveAuthority/${authorityPrefix}`);
399395
const result = await this._resolveAuthority(remoteAuthority);
400396
performance.mark(`code/didResolveAuthorityOK/${authorityPrefix}`);
401-
this._logService.info(`resolveAuthority(${authorityPrefix}) returned '${result.authority}' after ${sw.elapsed()} ms`);
397+
this._logService.info(`resolveAuthority(${authorityPrefix}) returned '${result.authority.connectTo}' after ${sw.elapsed()} ms`);
402398
return result;
403399
} catch (err) {
404400
performance.mark(`code/didResolveAuthorityError/${authorityPrefix}`);

0 commit comments

Comments
 (0)