diff --git a/dist/restore/index.js b/dist/restore/index.js
index 5a803e8..2e8694b 100644
--- a/dist/restore/index.js
+++ b/dist/restore/index.js
@@ -48997,8 +48997,7 @@ function run() {
             const isExactKeyMatch = utils.isExactKeyMatch(primaryKey, cacheKey);
             utils.setCacheHitOutput(isExactKeyMatch);
             if (!isExactKeyMatch && core.getInput(constants_1.Inputs.StrictRestore) == "true") {
-                core.info("Cache with exact key not found, hence exiting the workflow as strict-restore is set to true");
-                return;
+                throw new Error("Cache with exact key not found, hence exiting the workflow as strict-restore is set to true");
             }
             core.info(`Cache restored from key: ${cacheKey}`);
         }
diff --git a/src/restore.ts b/src/restore.ts
index 3142e3f..569b012 100644
--- a/src/restore.ts
+++ b/src/restore.ts
@@ -53,10 +53,9 @@ async function run(): Promise<void> {
         utils.setCacheHitOutput(isExactKeyMatch);
 
         if (!isExactKeyMatch && core.getInput(Inputs.StrictRestore) == "true") {
-            core.info(
+            throw new Error(
                 "Cache with exact key not found, hence exiting the workflow as strict-restore is set to true"
             );
-            return;
         }
         core.info(`Cache restored from key: ${cacheKey}`);
     } catch (error: unknown) {