Skip to content

Commit

Permalink
Handle ORA-01407
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgi committed Dec 12, 2024
1 parent c4f025e commit ea1022b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace EntityFramework.Exceptions.Oracle;
class OracleExceptionProcessorInterceptor : ExceptionProcessorInterceptor<OracleException>
{
private const int CannotInsertNull = 1400;
private const int CannotUpdateToNull = 1407;
private const int UniqueConstraintViolation = 1;
private const int IntegrityConstraintViolation = 2291;
private const int ChildRecordFound = 2292;
Expand All @@ -20,6 +21,7 @@ class OracleExceptionProcessorInterceptor : ExceptionProcessorInterceptor<Oracle
IntegrityConstraintViolation => DatabaseError.ReferenceConstraint,
ChildRecordFound => DatabaseError.ReferenceConstraint,
CannotInsertNull => DatabaseError.CannotInsertNull,
CannotUpdateToNull => DatabaseError.CannotInsertNull,
NumericOrValueError => DatabaseError.MaxLength,
NumericOverflow => DatabaseError.NumericOverflow,
UniqueConstraintViolation => DatabaseError.UniqueConstraint,
Expand Down
6 changes: 0 additions & 6 deletions EntityFramework.Exceptions.Tests/OracleTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ public class OracleTests : DatabaseTests, IClassFixture<OracleTestContextFixture
public OracleTests(OracleTestContextFixture fixture) : base(fixture.DemoContext)
{
}

[Fact(Skip = "Skipping until ORA-01407 is supported")]
public override Task RequiredColumnViolationThrowsCannotInsertNullExceptionThroughExecuteUpdate()
{
return Task.CompletedTask;
}
}

public class OracleTestContextFixture : DemoContextFixture<OracleContainer>
Expand Down

0 comments on commit ea1022b

Please sign in to comment.