@kakarot-ci/core 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -280,7 +280,10 @@ var GitHubClient = class {
280
280
  });
281
281
  return true;
282
282
  } catch (err) {
283
- if (err instanceof Error && err.message.includes("404")) {
283
+ if (err && typeof err === "object" && "status" in err && err.status === 404) {
284
+ return false;
285
+ }
286
+ if (err instanceof Error && (err.message.includes("404") || err.message.includes("Not Found"))) {
284
287
  return false;
285
288
  }
286
289
  throw err;
@@ -672,9 +675,14 @@ async function detectTestFile(filePath, ref, githubClient, testDirectory) {
672
675
  ...testPatterns.map((pattern) => `__tests__/${baseName}${pattern}`)
673
676
  ];
674
677
  for (const testPath of locations) {
675
- const exists = await githubClient.fileExists(ref, testPath);
676
- if (exists) {
677
- return testPath;
678
+ try {
679
+ const exists = await githubClient.fileExists(ref, testPath);
680
+ if (exists) {
681
+ return testPath;
682
+ }
683
+ } catch (err) {
684
+ debug(`Error checking test file ${testPath}: ${err instanceof Error ? err.message : String(err)}`);
685
+ continue;
678
686
  }
679
687
  }
680
688
  return void 0;