Remove NotFoundException; services return null on lookup miss

A missing record isn't exceptional — services now return null (logged
at Info) instead of throwing, and endpoints map null to 404. Agent and
import toolsets route not-found through their existing OrNotFound
result pattern rather than a caught exception.
This commit is contained in:
James Wampler
2026-08-06 21:22:40 -07:00
parent 189ebf3237
commit 2ccebb31eb
22 changed files with 305 additions and 212 deletions
+3 -5
View File
@@ -67,13 +67,11 @@ public class BeatServiceTests : ServiceTestFixture
}
[Test]
public void Reordering_with_an_unknown_beat_is_refused()
public async Task Reordering_with_an_unknown_beat_returns_null_rather_than_throwing()
{
Beats.CreateAsync(_chapterId, new CreateBeatRequest("First")).Wait();
await Beats.CreateAsync(_chapterId, new CreateBeatRequest("First"));
Assert.That(
async () => await Beats.ReorderAsync(_chapterId, new ReorderBeatsRequest([Guid.NewGuid()])),
Throws.TypeOf<NotFoundException>());
Assert.That(await Beats.ReorderAsync(_chapterId, new ReorderBeatsRequest([Guid.NewGuid()])), Is.Null);
}
[Test]