fix(iam-service): add try-catch to role seeding for visible error logging
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user