From c1f1611e78317a3898b910f582ac99cdca6d5b8d Mon Sep 17 00:00:00 2001 From: Huiwen Date: Tue, 19 Sep 2023 21:34:56 +0000 Subject: [PATCH] fix build --- components/gitpod-protocol/src/messaging/error.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/gitpod-protocol/src/messaging/error.ts b/components/gitpod-protocol/src/messaging/error.ts index f489c065dbf9f1..655edc73197949 100644 --- a/components/gitpod-protocol/src/messaging/error.ts +++ b/components/gitpod-protocol/src/messaging/error.ts @@ -5,8 +5,7 @@ */ import { scrubber } from "../util/scrubbing"; -import { ServerErrorResponse } from "@grpc/grpc-js/build/src/server-call"; -import { Status } from "@grpc/grpc-js/build/src/constants"; +import { Status } from "nice-grpc-common"; export class ApplicationError extends Error { constructor(public readonly code: ErrorCode, message: string, public readonly data?: any) { @@ -39,7 +38,9 @@ export namespace ApplicationError { } } - export function fromGRPCError(e: ServerErrorResponse, data?: any): ApplicationError { + export function fromGRPCError(e: any & Error, data?: any): ApplicationError { + // Argument e should be ServerErrorResponse + // But to reduce dependency requirement, we use Error here return new ApplicationError(categorizeRPCError(e.code), e.message, data); }