Unify automation endpoint 404 exceptions

[MAILPOET-5436]
This commit is contained in:
 Ján Mikláš
2024-07-01 13:04:32 +02:00
committed by Aschepikov
parent 8376494d6f
commit ac751871f9
5 changed files with 16 additions and 15 deletions

View File

@@ -68,6 +68,13 @@ class Exceptions {
->withMessage(sprintf(__("Automation with ID '%d' not found.", 'mailpoet'), $id));
}
public static function automationNotFoundInTimeSpan(int $id): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::AUTOMATION_NOT_FOUND)
// translators: %d is the ID of the automation.
->withMessage(sprintf(__("Automation with ID '%d' not found in selected time span.", 'mailpoet'), $id));
}
public static function automationVersionNotFound(int $automation, int $version): NotFoundException {
return NotFoundException::create()
->withErrorCode(self::AUTOMATION_VERSION_NOT_FOUND)