fix(specs): fail the task when a spec cannot be generated

The CLI reports a throw through its error hooks and then carries on, so a
spec that failed to generate left the task reporting success. The missing
file was met further down the pipeline, by the SDK build, which reads a spec
that isn't there as specs never having been run -- pointing at the wrong step
and hiding the reason in one marked green.

A platform that cannot be generated now says so and stops, which is what
lets the SDK preview workflow catch it here rather than in cloud.
This commit is contained in:
harsh mahajan committed 2026-08-10 10:25:28 +05:30
1 parent 567296ff34
commit 477cc61548
1 file changed
+6 -1
+6 -1
View File
@@ -779,7 +779,12 @@ class Specs extends Action
$parsedSpecs = $specs->parse();
$this->verifyParsedSpec($parsedSpecs);
} catch (\RuntimeException $e) {
throw new \RuntimeException("Spec generation failed for {$platform} ({$format}): " . $e->getMessage(), 0, $e);
// The CLI reports a throw and carries on, so a spec that
// failed to generate leaves the task reporting success and
// the missing file is met further down the pipeline, where
// it reads as specs never having been run.
Console::error("Spec generation failed for {$platform} ({$format}): " . $e->getMessage());
Console::exit(1);
}
$encodedSpecs = \json_encode($parsedSpecs, JSON_PRETTY_PRINT);