Add comprehensive error handling to Blueprint API creation endpoints#148
Draft
sei-awelle wants to merge 5 commits intomainfrom
Draft
Add comprehensive error handling to Blueprint API creation endpoints#148sei-awelle wants to merge 5 commits intomainfrom
sei-awelle wants to merge 5 commits intomainfrom
Conversation
- Enhanced MselService.CreateAsync with: - Name validation - PostgreSQL error handling (23505, 23503, 23514) - Detailed logging for create operations - Enhanced TeamService.CreateAsync with: - Name and MselId validation - Early FK validation for MselId - PostgreSQL error handling for all constraint violations - Comprehensive logging - Enhanced CardService.CreateAsync with: - Name validation - Optional MselId FK validation - PostgreSQL error handling - Improved debugging with structured logging - Consistent error messages across all services - Better visibility into creation failures during MSEL deployment
For consistency with other APIs: - Created ExceptionMiddleware with PostgreSQL error transformation - Registered in Startup.Configure (runs earlier in pipeline) - Removed JsonExceptionFilter registration from MVC - Removed UseDeveloperExceptionPage Simplified services by removing all try/catch blocks: - MselService.CreateAsync: -33 lines - TeamService.CreateAsync: -37 lines - CardService.CreateAsync: -34 lines Sanitized error messages: - Log detailed PostgreSQL info for debugging - Always return generic messages to users - Never expose database internals Matches architecture in Caster PR #77, Player PR #65, Gallery PR #57
Replaced by ExceptionMiddleware for consistency with other APIs
3632bfa to
04026be
Compare
Fetch all PlayerApplicationTeams upfront instead of querying inside the loop for each application. This reduces database round trips while maintaining sequential API call processing.
- Resolved conflicts in IntegrationPlayerExtensions (adopted parallel batching) - Added logging for team creation in TeamService - Integrated CITE team type and scoring model migrations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
MselService.cs:
TeamService.cs:
CardService.cs:
Benefits
Testing