From 50a31faa052d86f132305c8fd893a48c8c787b1d Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 13 Nov 2023 16:38:40 -0500 Subject: [PATCH] Adds/handles title limit on cloud patches --- src/plus/drafts/draftsService.ts | 5 +++++ src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plus/drafts/draftsService.ts b/src/plus/drafts/draftsService.ts index 87fc9b8..c7d52de 100644 --- a/src/plus/drafts/draftsService.ts +++ b/src/plus/drafts/draftsService.ts @@ -82,6 +82,11 @@ export class DraftService implements Disposable { } satisfies CreateDraftRequest), }); + if (!createDraftRsp.ok) { + const json = (await createDraftRsp.json()) as { error?: { message?: string } } | undefined; + throw new Error(json?.error?.message ?? createDraftRsp.statusText); + } + const createDraft = ((await createDraftRsp.json()) as DraftResult).data; const draftId = createDraft.id; diff --git a/src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts b/src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts index 65c7a52..fac8518 100644 --- a/src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts +++ b/src/webviews/apps/plus/patchDetails/components/gl-patch-create.ts @@ -118,12 +118,12 @@ export class GlPatchCreate extends GlTreeBase { `, )}
-
-