Skip to content

Empty catch block and fragile error step detection #13

@sgardoll

Description

@sgardoll

Summary

Two related error handling problems:

1. Empty catch block (line 2791)

} catch (e) {}

Inside commit error handling path. If JSON parse of error map fails, the error is silently swallowed. User sees generic "commit failed" without FlutterFlow's actual build errors.

2. Fragile error step detection (lines 3810-3819)

if (error.message.includes("Claude") || error.message.includes("OpenAI")) {
  errorStep = 2;
} else if (error.message.includes("Code Review")) {
  errorStep = 3;
}

Error routing depends on substring matching. A Gemini error containing the word "Claude" would be misattributed to step 2.

Suggested Fixes

Empty catch

} catch (e) {
  console.warn("Failed to parse error map from commit response:", e);
}

Error step detection

Use structured error types:

class PipelineError extends Error {
  constructor(message, step) {
    super(message);
    this.step = step;
  }
}
// Usage:
throw new PipelineError("Code Generator failed", 2);
// Catch:
errorStep = error.step ?? 1;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions