fix(iam-service): add try-catch to role seeding for visible error logging

This commit is contained in:
Ho Ngoc Hai
2026-03-01 06:17:08 +07:00
parent f353f8843e
commit ea59326658

View File

@@ -269,7 +269,15 @@ if (app.Environment.IsDevelopment())
// EN: Seed system roles on startup
// VI: Seed system roles khi khởi động
await IamService.Infrastructure.Data.DataSeeder.SeedRolesAsync(app.Services);
try
{
await IamService.Infrastructure.Data.DataSeeder.SeedRolesAsync(app.Services);
logger.LogInformation("System roles seeding completed successfully.");
}
catch (Exception ex)
{
logger.LogError(ex, "Failed to seed system roles: {Message}", ex.Message);
}
// EN: Configure middleware pipeline / VI: Cấu hình middleware pipeline
app.UseSerilogRequestLogging();