Giorgi / EntityFramework.Exceptions

Strongly typed exceptions for Entity Framework Core. Supports SQLServer, PostgreSQL, SQLite, Oracle and MySql.
https://giorgi.dev/entity-framework/introducing-entityframework-exceptions/
Other
1.44k stars 68 forks source link

MySql exceptions not working #25

Closed sajidali2444 closed 3 years ago

sajidali2444 commented 4 years ago

Thank you for your nice package. but on my side, it is not working here is my startup class configuration var connection = Startup.Configuration["Data:xeride_db"]; options.UseMySql(connection, b => { b.MigrationsAssembly("XERide.API"); }).UseExceptionProcessor();

Account controller create user method try { IdentityResult result = await _userManager.CreateAsync(user, model.Password); } catch (UniqueConstraintException e) { return BadRequest(e.Message); //Handle exception here }

I can't catch exception control goes out before reach to catch block. any direction sir.

I also visited your MySQL server test class and try to configure

Giorgi commented 4 years ago

Which MySql Entity Framework provider do you use and which version of EF Core?

sajidali2444 commented 4 years ago

MySql provider Pomelo.EntityFrameworkCore.MySql 3 .Net Core 3.1 EF Core 3

Giorgi commented 4 years ago

Please provide a minimal repro which reproduces the issue

Giorgi commented 3 years ago

Closing due to inactivity