• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Giorgi / EntityFramework.Exceptions / 17267773769

27 Aug 2025 01:13PM UTC coverage: 91.496% (-0.3%) from 91.824%
17267773769

Pull #89

github

web-flow
Merge 2175fe773 into 0c455bbef
Pull Request #89: Add IsDeadlockError

123 of 145 branches covered (84.83%)

Branch coverage included in aggregate %.

9 of 9 new or added lines in 5 files covered. (100.0%)

1 existing line in 1 file now uncovered.

189 of 196 relevant lines covered (96.43%)

38.75 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.47
/EntityFramework.Exceptions/Common/ExceptionFactory.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Data.Common;
4
using Microsoft.EntityFrameworkCore.ChangeTracking;
5

6
namespace EntityFramework.Exceptions.Common;
7

8
static class ExceptionFactory
9
{
10
    internal static Exception Create<T>(ExceptionProcessorInterceptor<T>.DatabaseError error, Exception exception, IReadOnlyList<EntityEntry> entries) where T : DbException
11
    {
127✔
12
        return error switch
127!
13
        {
127✔
14
            ExceptionProcessorInterceptor<T>.DatabaseError.CannotInsertNull => new CannotInsertNullException("Cannot insert null", exception.InnerException, entries),
20✔
15
            ExceptionProcessorInterceptor<T>.DatabaseError.MaxLength => new MaxLengthExceededException("Maximum length exceeded", exception.InnerException, entries),
16✔
16
            ExceptionProcessorInterceptor<T>.DatabaseError.NumericOverflow => new NumericOverflowException("Numeric overflow", exception.InnerException, entries),
14✔
17
            ExceptionProcessorInterceptor<T>.DatabaseError.ReferenceConstraint => new ReferenceConstraintException("Reference constraint violation", exception.InnerException, entries),
40✔
18
            ExceptionProcessorInterceptor<T>.DatabaseError.UniqueConstraint => new UniqueConstraintException("Unique constraint violation", exception.InnerException, entries),
34✔
19
            ExceptionProcessorInterceptor<T>.DatabaseError.DeadLock => new DeadlockException("Deadlock", exception.InnerException, entries),
3✔
UNCOV
20
            _ => null,
×
21
        };
127✔
22
    }
127✔
23
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc