From 5809c5dc63dd56167574d2d593e883852ba2f6ac Mon Sep 17 00:00:00 2001
From: Aparna Jyothi <aparnajyothi-y@github.com>
Date: Thu, 30 Jan 2025 17:09:26 +0530
Subject: [PATCH] error for wrong URL

---
 dist/setup/index.js                    | 3 +++
 src/distributions/base-distribution.ts | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/dist/setup/index.js b/dist/setup/index.js
index 278becce..babe4b66 100644
--- a/dist/setup/index.js
+++ b/dist/setup/index.js
@@ -100238,6 +100238,9 @@ class BaseDistribution {
                 exeUrl = `${initialUrl}/v${version}/win-${osArch}/node.exe`;
                 libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`;
                 core.info(`Downloading only node binary from ${exeUrl}`);
+                if (!exeUrl) {
+                    core.error('unable to download node binary with the provided URL. Please check and try again');
+                }
                 const exePath = yield tc.downloadTool(exeUrl);
                 yield io.cp(exePath, path.join(tempDir, 'node.exe'));
                 const libPath = yield tc.downloadTool(libUrl);
diff --git a/src/distributions/base-distribution.ts b/src/distributions/base-distribution.ts
index f2fb1976..1eb20e6d 100644
--- a/src/distributions/base-distribution.ts
+++ b/src/distributions/base-distribution.ts
@@ -211,6 +211,8 @@ export default abstract class BaseDistribution {
       libUrl = `${initialUrl}/v${version}/win-${osArch}/node.lib`;
 
       core.info(`Downloading only node binary from ${exeUrl}`);
+      if(!exeUrl ){core.error('unable to download node binary with the provided URL. Please check and try again');}
+      
 
       const exePath = await tc.downloadTool(exeUrl);
       await io.cp(exePath, path.join(tempDir, 'node.exe'));