Make all automation strings in PHP translatable, improve context/comments

[MAILPOET-4611]
This commit is contained in:
Jan Jakes
2022-10-20 13:10:43 +02:00
committed by Aschepikov
parent a7277f3437
commit 421549d6ee
5 changed files with 13 additions and 5 deletions

View File

@ -3,11 +3,11 @@
namespace MailPoet\Automation\Engine\Builder;
use MailPoet\Automation\Engine\Data\Workflow;
use MailPoet\Automation\Engine\Exceptions;
use MailPoet\Automation\Engine\Exceptions\InvalidStateException;
use MailPoet\Automation\Engine\Storage\WorkflowStorage;
use MailPoet\Automation\Engine\Storage\WorkflowTemplateStorage;
use MailPoet\Automation\Engine\Validation\WorkflowValidator;
use MailPoet\UnexpectedValueException;
class CreateWorkflowFromTemplateController {
/** @var WorkflowStorage */
@ -32,7 +32,7 @@ class CreateWorkflowFromTemplateController {
public function createWorkflow(string $slug): Workflow {
$template = $this->templateStorage->getTemplateBySlug($slug);
if (!$template) {
throw UnexpectedValueException::create()->withMessage('Template not found.');
throw Exceptions::workflowTemplateNotFound($slug);
}
$workflow = $template->getWorkflow();