Skip to content

Commit

Permalink
fix(cli): improve flow cli dependency error clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Feb 20, 2025
1 parent 2c67e84 commit d5b3a04
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cli/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,20 @@ export async function updateFlow(
try {
const res = (await rawResponse.json()) as
| { updated_flow_value: any }
| { error: { message: string } }
| undefined;
return res?.updated_flow_value;
if (rawResponse.status != 200) {
const msg = (res as any)?.["error"]?.["message"]
if (msg) {
throw new LockfileGenerationError(
`Failed to generate lockfile: ${msg}`
);
}
throw new LockfileGenerationError(
`Failed to generate lockfile: ${rawResponse.statusText}, ${responseText}`
);
}
return (res as any).updated_flow_value;
} catch (e) {
try {
responseText = await rawResponse.text();
Expand Down

0 comments on commit d5b3a04

Please sign in to comment.