Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support for exceptions thrown from ExecuteUpdate and ExecuteDelete #81

Closed
MarkusG opened this issue Nov 7, 2024 · 0 comments
Closed

Comments

@MarkusG
Copy link
Contributor

MarkusG commented Nov 7, 2024

Because the project uses a SaveChangesInterceptor, exceptions thrown by calls to ExecuteUpdate or ExecuteDelete or their async variants will not be intercepted. Supporting these is simple enough: just add a DbCommandInterceptor overriding CommandFailed(Async). However, the current structure of the project doesn't allow this to be done easily, as each provider provides its own interceptor, and the DatabaseError enum is a member of the ExceptionProcessorInterceptor class.

I propose each provider has its own exception processor, but there be only one SaveChangesInterceptor and DbCommandInterceptor for project. The interceptors can take the provider's exception processor in their constructors when instantiated in UseExceptionProcessor().

For now, I'm working on a PR to add support using the existing pattern with an extra interceptor for each provider, but I'm creating an issue for discussion.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants