Skip to content

Commit 85f07c6

Browse files
meorphismeorphis
andauthored
fix: catch guesser errors (#211)
Co-authored-by: meorphis <eric@stainless.com>
1 parent 319cfc9 commit 85f07c6

File tree

4 files changed

+72
-56
lines changed

4 files changed

+72
-56
lines changed

dist/build.js

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/merge.js

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/preview.js

Lines changed: 18 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runBuilds.ts

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -121,20 +121,24 @@ export async function* runBuilds({
121121
logger.debug("Guessing config before branch reset");
122122
// If the `branch` already exists, we should guess against it, in case
123123
// there were changes made via the studio.
124-
if (hasBranch) {
125-
configContent = Object.values(
126-
await stainless.projects.configs.guess({
127-
branch,
128-
spec: oasContent!,
129-
}),
130-
)[0]?.content;
131-
} else {
132-
configContent = Object.values(
133-
await stainless.projects.configs.guess({
134-
branch: branchFrom,
135-
spec: oasContent!,
136-
}),
137-
)[0]?.content;
124+
try {
125+
if (hasBranch) {
126+
configContent = Object.values(
127+
await stainless.projects.configs.guess({
128+
branch,
129+
spec: oasContent!,
130+
}),
131+
)[0]?.content;
132+
} else {
133+
configContent = Object.values(
134+
await stainless.projects.configs.guess({
135+
branch: branchFrom,
136+
spec: oasContent!,
137+
}),
138+
)[0]?.content;
139+
}
140+
} catch (e) {
141+
logger.warn("Error guessing config, continuing anyways", e);
138142
}
139143
} else if (hasBranch && hasBaseBranch) {
140144
logger.debug("Computing config patch before branch reset");

0 commit comments

Comments
 (0)