diff --git a/src/api/retry.ts b/src/api/retry.ts index 6c4644e..982603a 100644 --- a/src/api/retry.ts +++ b/src/api/retry.ts @@ -22,7 +22,9 @@ async function executeWithRetry( if (operationType === "fetch") { Logger.error(`${chalk.red("✗")} ${chalk.cyan(filePath)}: ${errorMessage}`) } - throw new Error(`Failed to ${operationType} ${filePath} after ${MAX_RETRIES} retries: ${errorMessage}`) + throw new Error(`Failed to ${operationType} ${filePath} after ${MAX_RETRIES} retries: ${errorMessage}`, { + cause: error + }) } const delay = INITIAL_RETRY_DELAY * Math.pow(2, retryCount) Logger.warn( diff --git a/src/config/authConfig.ts b/src/config/authConfig.ts index 3d7ac48..d9fba43 100644 --- a/src/config/authConfig.ts +++ b/src/config/authConfig.ts @@ -32,10 +32,10 @@ export function parseAuthFile({ allowIncomplete }: { allowIncomplete?: boolean } return AuthConfigSchema.parse(rawConfig) } catch (error) { if (error instanceof z.ZodError) { - throw new Error(`Invalid auth file at ${AuthConfigFilePath}: ${error.message}`) + throw new Error(`Invalid auth file at ${AuthConfigFilePath}: ${error.message}`, { cause: error }) } if (error instanceof SyntaxError) { - throw new Error(`Invalid JSON in auth file at ${AuthConfigFilePath}: ${error.message}`) + throw new Error(`Invalid JSON in auth file at ${AuthConfigFilePath}: ${error.message}`, { cause: error }) } throw error } diff --git a/src/config/fileConfig.ts b/src/config/fileConfig.ts index 02d9e11..64d5063 100644 --- a/src/config/fileConfig.ts +++ b/src/config/fileConfig.ts @@ -29,10 +29,10 @@ export function parseConfigFile({ return PartialPersistentConfigSchema.parse(rawConfig) } catch (error) { if (error instanceof z.ZodError) { - throw new Error(`Invalid configuration file at ${configPath}: ${error.message}`) + throw new Error(`Invalid configuration file at ${configPath}: ${error.message}`, { cause: error }) } if (error instanceof SyntaxError) { - throw new Error(`Invalid JSON in configuration file at ${configPath}: ${error.message}`) + throw new Error(`Invalid JSON in configuration file at ${configPath}: ${error.message}`, { cause: error }) } throw error } diff --git a/src/modules/deployments/redeploy.ts b/src/modules/deployments/redeploy.ts index 3857c50..6203088 100644 --- a/src/modules/deployments/redeploy.ts +++ b/src/modules/deployments/redeploy.ts @@ -14,7 +14,7 @@ type RedeployOptions = { } export async function deploymentsRedeploy({ deploymentId, force }: RedeployOptions) { - let selectedDeployment = null + let selectedDeployment let selectedDeploymentId if (deploymentId) {