@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/index.cjs CHANGED
@@ -441,7 +441,10 @@ var GitHubClient = class {
441
441
  });
442
442
  return true;
443
443
  } catch (err) {
444
- if (err instanceof Error && err.message.includes("404")) {
444
+ if (err && typeof err === "object" && "status" in err && err.status === 404) {
445
+ return false;
446
+ }
447
+ if (err instanceof Error && (err.message.includes("404") || err.message.includes("Not Found"))) {
445
448
  return false;
446
449
  }
447
450
  throw err;
@@ -728,9 +731,14 @@ async function detectTestFile(filePath, ref, githubClient, testDirectory) {
728
731
  ...testPatterns.map((pattern) => `__tests__/${baseName}${pattern}`)
729
732
  ];
730
733
  for (const testPath of locations) {
731
- const exists = await githubClient.fileExists(ref, testPath);
732
- if (exists) {
733
- return testPath;
734
+ try {
735
+ const exists = await githubClient.fileExists(ref, testPath);
736
+ if (exists) {
737
+ return testPath;
738
+ }
739
+ } catch (err) {
740
+ debug(`Error checking test file ${testPath}: ${err instanceof Error ? err.message : String(err)}`);
741
+ continue;
734
742
  }
735
743
  }
736
744
  return void 0;