From 9ff00006707392e4a82081c50dc6b99a0d207858 Mon Sep 17 00:00:00 2001 From: Justin Hutchings Date: Mon, 26 Aug 2024 22:39:44 +0000 Subject: [PATCH] Add debugging --- componentDetection.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/componentDetection.ts b/componentDetection.ts index 24d8e46..45ba0ac 100644 --- a/componentDetection.ts +++ b/componentDetection.ts @@ -152,7 +152,8 @@ export default class ComponentDetection { const repo = "component-detection"; core.debug("Attempting to download latest release from " + serverUrl); - const latestRelease = await octokit.rest.repos.getLatestRelease({ + try { + const latestRelease = await octokit.rest.repos.getLatestRelease({ owner, repo }); @@ -165,6 +166,10 @@ export default class ComponentDetection { }); return downloadURL; + } catch (error: any) { + core.error(error); + throw new Error("Failed to download latest release"); + } } }