Skip to content

fix(#251): prevent startup crash when database migration fails on sta…#315

Merged
bllr777 merged 1 commit into
mainfrom
feature/251-waitlist-landing-page
May 23, 2026
Merged

fix(#251): prevent startup crash when database migration fails on sta…#315
bllr777 merged 1 commit into
mainfrom
feature/251-waitlist-landing-page

Conversation

@bllr777
Copy link
Copy Markdown
Collaborator

@bllr777 bllr777 commented May 23, 2026

…ging

Summary

If MigrateAsync() throws at startup (e.g. transient DB connectivity issue, schema mismatch on staging), the entire process was crashing before UseCors ran — causing 503 on ALL endpoints and no CORS headers on any response.

Wrap MigrateAsync in try-catch so the app starts and serves requests even if the migration step fails. The error is logged for ops visibility.

Changes

API

  • Program.cs: wrap startup MigrateAsync in try-catch with error logging

…ging

## Summary
If MigrateAsync() throws at startup (e.g. transient DB connectivity issue,
schema mismatch on staging), the entire process was crashing before UseCors
ran — causing 503 on ALL endpoints and no CORS headers on any response.

Wrap MigrateAsync in try-catch so the app starts and serves requests even
if the migration step fails. The error is logged for ops visibility.

## Changes
### API
- Program.cs: wrap startup MigrateAsync in try-catch with error logging
@bllr777 bllr777 merged commit 195a065 into main May 23, 2026
8 checks 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