From c0f998fe7f10aa6bcfc802af0e030146ac8438a7 Mon Sep 17 00:00:00 2001 From: Brad Harris Date: Tue, 7 Nov 2023 21:35:48 +0000 Subject: [PATCH] use ApplicationError's --- .../server/src/api/configuration-service-api.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/components/server/src/api/configuration-service-api.ts b/components/server/src/api/configuration-service-api.ts index cc8f7fa4907417..3176ed07f4cb73 100644 --- a/components/server/src/api/configuration-service-api.ts +++ b/components/server/src/api/configuration-service-api.ts @@ -19,6 +19,7 @@ import { ListConfigurationsResponse, } from "@gitpod/public-api/lib/gitpod/v1/configuration_pb"; import { PaginationResponse } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; +import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; @injectable() export class ConfigurationServiceAPI implements ServiceImpl { @@ -34,13 +35,13 @@ export class ConfigurationServiceAPI implements ServiceImpl { if (!req.organizationId) { - throw new Error("organizationId is required"); + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "organizationId is required"); } if (!req.cloneUrl) { - throw new Error("cloneUrl is required"); + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "cloneUrl is required"); } if (!req.name) { - throw new Error("name is required"); + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "name is required"); } const project = await this.projectService.createProject( @@ -61,7 +62,7 @@ export class ConfigurationServiceAPI implements ServiceImpl