Skip to content

Bug: CachedTopicRepository.Load() doesn't throw TopicNotFoundException #57

Open
@JeremyCaney

Description

@JeremyCaney

When SqlTopicRepository,Load() can't find a Topic, it throws a TopicNotFoundException. When CachedTopicRepository.Load() can't find a topic, it returns null. In fact, the signature for Load() on SqlTopicRepository returns a Topic, whereas the signature for Load() on CachedTopicRepository (and, incidentally, ITopicRepository) returns a Topic?.

There are good arguments for returning null vs. throwing an exception here. But the behavior and the return type nullability should be consistent—or, at least, clearly documented. That said, updating this behavior is a breaking change, and so this may need to wait until OnTopic 6.0.0.

Metadata

Metadata

Assignees

Labels

Area: RepositoriesRelates to the `ITopicRepository` interface or one of its implementations.Priority: 2Severity 1: MinorStatus 2: ScheduledPlanned for an upcoming release.Type: BugBehavior that is inconsistent with documented or expected behavior.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions