mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
fix sigpipe detection, use archive path given by client
This commit is contained in:
parent
c600c10579
commit
9bf083f846
|
@ -143,7 +143,7 @@ async fn handle_serve(
|
|||
Some(AnyCodeServer::Socket(s)) => s,
|
||||
Some(_) => return Err(MismatchedLaunchModeError().into()),
|
||||
None => {
|
||||
sb.setup(None).await?;
|
||||
sb.setup(Some(params.archive_path.into())).await?;
|
||||
sb.listen_on_default_socket().await?
|
||||
}
|
||||
};
|
||||
|
|
|
@ -85,7 +85,12 @@ export function setUnexpectedErrorHandler(newUnexpectedErrorHandler: (e: any) =>
|
|||
* @see https://github.com/microsoft/vscode-remote-release/issues/6481
|
||||
*/
|
||||
export function isSigPipeError(e: unknown): e is Error {
|
||||
return !!e && typeof e === 'object' && (<any>e).code === 'EPIPE' && (<any>e).syscall === 'WRITE';
|
||||
if (!e || typeof e !== 'object') {
|
||||
return false;
|
||||
}
|
||||
|
||||
const cast = e as Record<string, string | undefined>;
|
||||
return cast.code === 'EPIPE' && cast.syscall?.toUpperCase() === 'WRITE';
|
||||
}
|
||||
|
||||
export function onUnexpectedError(e: any): undefined {
|
||||
|
|
Loading…
Reference in a new issue