Skip to content

robust error logging on repo creation - #107

Merged
tnm merged 3 commits into
mainfrom
rest-debug
Jun 26, 2025
Merged

robust error logging on repo creation#107
tnm merged 3 commits into
mainfrom
rest-debug

Conversation

@tnm

@tnm tnm commented Jun 26, 2025

Copy link
Copy Markdown
Contributor

What This PR Does

This PR adds comprehensive error handling and logging to the repository creation endpoint in the FastAPI application. It replaces the previous bare function call with robust exception handling that maps different types of failures to appropriate HTTP status codes and user-friendly error messages.

Key Changes

  • Wraps the repository creation logic in a try-catch block with multiple exception handlers
  • Maps subprocess.CalledProcessError (git command failures) to 404/500 status codes based on error type
  • Handles FileNotFoundError and ValueError exceptions with appropriate 404/400 responses
  • Adds fallback error detection using string matching for common failure scenarios (authentication, permissions, network issues)
  • Imports subprocess module to handle git-related process errors

Impact

  • Areas affected: Repository registration endpoint (/repository POST)
  • Benefits: Better user experience with meaningful error messages, proper HTTP status codes for different failure modes, improved debugging capability
  • Risks: Minimal - purely additive error handling that shouldn't affect successful operations

Generated by kit v1.3.1 • Model: claude-sonnet-4-20250514

@tnm
tnm merged commit 8e95abf into main Jun 26, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant