Error handling of EditEventCommand and DeleteEventCommand (and related code) is slightly confusing:
- EventStore::deleteRegistration is guaranteed to succeed, whereas ::saveRegistration returns a StatusValue, suggesting it may fail while it really can't (that is, it could fail but then it will throw an exception that should not be caught by us)
- EditEventCommand has dead code for handling the return value of ::saveRegistration, which again can never really fail
- DeleteEventCommand::deleteUnsafe returns a StatusValue, suggesting that the operation could fail, but it presently can't, nor is it documented to do so.
- The page deletion hook handler implicitly assumes that ::deleteUnsafe will succeed, but that's not guaranteed.
Acceptance criteria
- (no need to QA) All methods in EventStore should be guaranteed to succeed, for consistency
- (no need to QA) Their callers should be updated accordingly
- (no need to QA) The documentation of DeleteEventCommand::deleteUnsafe should make it clear that the operation could possibly fail
- (no need to QA) When an event page is deleted, we should use the onPageDelete hook instead of onPageDeleteComplete, which allows us to abort the deletion of the page if there's an error
- Editing event registrations should still be functional
- Deleting event registrations should still be functional
- Deleting an event page should also delete the associated registration, as before