Improved API Error Handling

June 20, 2023

One of the challenges in building robust integrations is handling edge cases gracefully. We’ve improved our GET branch endpoint to make programmatic repository management safer and more reliable.

The Challenge

When building automated systems that manage multiple repositories, you often encounter scenarios where:

  • Repositories aren’t added to Merge Freeze (yet!)
  • Repository names change or are deleted
  • Projects are being dynamically created and managed via our API

Previously, trying to check the status of a non-existent repository would return an error, requiring additional error handling logic in your applications.

The Solution

The GET branch endpoint now safely returns a blank response if the repository is not found in your account, instead of throwing an error.

Before

curl "<Merge Freeze API>your-non-existent-repo/main"
# Would return an error response
**ERROR**

After

curl "<Merge Freeze API>your-non-existent-repo/main"
# Returns an empty response instead of an error
{}

Robust Integration Benefits

Simplified Integration Logic

Your applications can now make branch status requests without complex error handling.

Robust Automation Workflows

Build more reliable automation that handles repository lifecycle management.

Perfect for Dynamic Project Management

This improvement is especially valuable for customers using our Create Branches endpoint to manage projects programmatically. You can now:

  1. Check if a repository already exists
  2. Create it if it doesn’t
  3. Configure freeze settings
  4. All without worrying about error handling for missing repos

Learn More

For complete details on error handling and response formats, check out our updated documentation:

This change makes building robust, automated deployment workflows easier than ever. As always, if you have questions or need help implementing these improvements, reach out to us at hello@mergefreeze.com.