Skip to content

Commit

Permalink
pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
pelikhan committed Aug 21, 2024
1 parent 8f49aa3 commit 3ba0062
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/cli/src/run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
GENAI_ANY_REGEX,
TRACE_CHUNK,
UNRECOVERABLE_ERROR_CODES,
SUCCESS_ERROR_CODE,
} from "../../core/src/constants"
import { isCancelError, errorMessage } from "../../core/src/error"
import { Fragment, GenerationResult } from "../../core/src/generation"
Expand Down Expand Up @@ -86,7 +87,11 @@ export async function runScriptWithExitCode(
for (let r = 0; r < runRetry; ++r) {
const res = await runScript(scriptId, files, options)
exitCode = res.exitCode
if (UNRECOVERABLE_ERROR_CODES.includes(exitCode)) break
if (
exitCode === SUCCESS_ERROR_CODE ||
UNRECOVERABLE_ERROR_CODES.includes(exitCode)
)
break

const delayMs = 2000 * Math.pow(2, r)
console.error(
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export const USER_CANCELLED_ERROR_CODE = -7
export const CONFIGURATION_ERROR_CODE = -8

export const UNRECOVERABLE_ERROR_CODES = Object.freeze([
0,
CONNECTION_CONFIGURATION_ERROR_CODE,
USER_CANCELLED_ERROR_CODE,
FILES_NOT_FOUND_ERROR_CODE,
Expand Down

0 comments on commit 3ba0062

Please sign in to comment.