} else { yield NewsletterException::NEWSLETTER_RECIPIENT_NOT_FOUND_CODE =>
[ 'exception' => NewsletterException::
recipientNotFound('id-1', 'value-1'
),
'statusCode' => Response::HTTP_BAD_REQUEST,
'errorCode' => NewsletterException::NEWSLETTER_RECIPIENT_NOT_FOUND_CODE,
'message' => 'The NewsletterRecipient with the identifier "id-1" - value-1 was not found.',
];
} yield NewsletterException::NEWSLETTER_RECIPIENT_THROTTLED =>
[ 'exception' => NewsletterException::
newsletterThrottled(2
),
'statusCode' => Response::HTTP_TOO_MANY_REQUESTS,
'errorCode' => NewsletterException::NEWSLETTER_RECIPIENT_THROTTLED,
'message' => 'Too many requests, try again in 2 seconds.',
];
}}