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 { `, )}
-
-