Skip to content

Commit

Permalink
tweak(Calendar/Model/Event): use Tinebase_Exception_SystemGeneric for…
Browse files Browse the repository at this point in the history
… rrule until validation fail

... we don't need this in sentry (user input)
  • Loading branch information
pschuele committed Sep 10, 2024
1 parent 224112a commit 01c8346
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/tine20/Calendar/Controller/RecurTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public function testInvalidRruleUntil()
'container_id' => $this->_getTestCalendar()->getId(),
));

$this->expectException('Tinebase_Exception_Record_Validation');
$persistentEvent = $this->_controller->create($event);
$this->expectException(Tinebase_Exception_SystemGeneric::class);
$this->_controller->create($event);
}

/**
Expand Down
3 changes: 2 additions & 1 deletion tine20/Calendar/Model/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,8 @@ public function setRruleUntil()
}

if ($this->rrule_until && $this->rrule_until->getTimeStamp() - $this->dtstart->getTimeStamp() < -1) {
throw new Tinebase_Exception_Record_Validation('rrule until must not be before dtstart');
$translation = Tinebase_Translation::getTranslation(Calendar_Config::APP_NAME);
throw new Tinebase_Exception_SystemGeneric($translation->_('Until has to be after event start'));
}
}
public static function resetFreeBusyCleanupCache()
Expand Down

0 comments on commit 01c8346

Please sign in to comment.