diff --git a/cli/flow.ts b/cli/flow.ts index f47d319a07..929e0c2b34 100644 --- a/cli/flow.ts +++ b/cli/flow.ts @@ -115,14 +115,20 @@ export async function pushFlow( }); } else { log.info(colors.bold.yellow("Creating new flow...")); - await FlowService.createFlow({ - workspace: workspace, - requestBody: { - path: remotePath.replaceAll(SEP, "/"), - deployment_message: message, - ...localFlow, - }, - }); + try { + await FlowService.createFlow({ + workspace: workspace, + requestBody: { + path: remotePath.replaceAll(SEP, "/"), + deployment_message: message, + ...localFlow, + }, + }); + } catch (e) { + throw new Error( + `Failed to create flow ${remotePath}: ${e.body ?? e.message}` + ); + } } } diff --git a/cli/folder.ts b/cli/folder.ts index 4c1ddd85c0..ecc6e56e24 100644 --- a/cli/folder.ts +++ b/cli/folder.ts @@ -92,8 +92,7 @@ export async function pushFolder( }, }); } catch (e) { - console.error(e.body); - throw e; + throw Error(`Failed to create folder ${name}: ${e.body ?? e.message}`); } } } diff --git a/cli/script.ts b/cli/script.ts index 408f131b60..5ac01324f6 100644 --- a/cli/script.ts +++ b/cli/script.ts @@ -366,11 +366,19 @@ async function createScript( workspace: Workspace ) { if (!bundleContent) { - // no parent hash - await ScriptService.createScript({ - workspace: workspaceId, - requestBody: body, - }); + try { + // no parent hash + await ScriptService.createScript({ + workspace: workspaceId, + requestBody: body, + }); + } catch (e) { + throw Error( + `Script creation for ${body.path} with parent ${ + body.parent_hash + } was not successful: ${e.body ?? e.message}` + ); + } } else { const form = new FormData(); form.append("script", JSON.stringify(body));