From d2ca38a1670621fc267dfc9ab6775e4de51ed7e5 Mon Sep 17 00:00:00 2001 From: Alex Tugarev Date: Wed, 19 Jul 2023 14:22:21 +0000 Subject: [PATCH] [jsonrpc] fix missing data fields --- components/gitpod-protocol/src/messaging/error.ts | 2 +- components/server/src/websocket/websocket-connection-manager.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/gitpod-protocol/src/messaging/error.ts b/components/gitpod-protocol/src/messaging/error.ts index fa2caf33794de1..afbc85bb1641e3 100644 --- a/components/gitpod-protocol/src/messaging/error.ts +++ b/components/gitpod-protocol/src/messaging/error.ts @@ -22,7 +22,7 @@ export class ApplicationError extends Error { } export namespace ApplicationError { - export function hasErrorCode(e: any): e is Error & { code: ErrorCode } { + export function hasErrorCode(e: any): e is Error & { code: ErrorCode; data?: any } { return e && e.code !== undefined; } } diff --git a/components/server/src/websocket/websocket-connection-manager.ts b/components/server/src/websocket/websocket-connection-manager.ts index b9a38a5e69e57a..3e70997bc37913 100644 --- a/components/server/src/websocket/websocket-connection-manager.ts +++ b/components/server/src/websocket/websocket-connection-manager.ts @@ -434,7 +434,7 @@ class GitpodJsonRpcProxyFactory extends JsonRpcProxyFactory message: e.message, }, ); - throw new ResponseError(e.code, e.message); + throw new ResponseError(e.code, e.message, e.data); } else { TraceContext.setError(ctx, e); // this is a "real" error