From 72ab2dcd58b9883113722e6ec893db9450acef93 Mon Sep 17 00:00:00 2001 From: cmoulliard Date: Mon, 19 Feb 2024 14:13:34 +0100 Subject: [PATCH] Reviewing the change wording. Add the root cause of the error of: checkGiteaOrg to allow to know if there is a certificate error Signed-off-by: cmoulliard --- .changeset/weak-flowers-repeat.md | 3 ++- plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.changeset/weak-flowers-repeat.md b/.changeset/weak-flowers-repeat.md index 4d0d4ce2b7..ed71acd332 100644 --- a/.changeset/weak-flowers-repeat.md +++ b/.changeset/weak-flowers-repeat.md @@ -2,4 +2,5 @@ '@backstage/plugin-scaffolder-backend-module-gitea': patch --- -Add missing break within the while statement to exit from the while maxDuration statement when the gitea repository has been created and exists +Fix issue for infinite loop when repository already exists +Log the root cause of error reported by checkGiteaOrg diff --git a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts index 875e6188a9..089f9b2669 100644 --- a/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts +++ b/plugins/scaffolder-backend-module-gitea/src/actions/gitea.ts @@ -80,7 +80,9 @@ const checkGiteaOrg = async ( getOptions, ); } catch (e) { - throw new Error(`Unable to get the Organization: ${owner}, ${e}`); + throw new Error( + `Unable to get the Organization: ${owner}; Error cause: ${e.cause.message}`, + ); } if (response.status !== 200) { throw new Error(