Exceptions
Exception
Symfony\Component\HttpKernel\Exception\ BadRequestHttpException
$concatenatedList
)
);
}
if ($response['status'] !== 'subscribed') {
throw new BadRequestHttpException(
sprintf('Response status is %s instead of %s', $response['status'], 'subscribed')
);
}
}
in
vendor/bitbag/mailchimp-plugin/src/Handler/NewsletterSubscriptionHandler.php
->
exportNewEmail
(line 185)
throw new UnauthorizedHttpException('Mailchimp', $response['detail']);
}
if (Response::HTTP_NOT_FOUND === $response['status']) {
$this->exportNewEmail($email);
}
}
private function getListMemberEndpoint(string $email = null): string
{
in
vendor/bitbag/mailchimp-plugin/src/Handler/NewsletterSubscriptionHandler.php
->
addMailchimpData
(line 66)
if (!$customer instanceof CustomerInterface) {
$customer = $this->createNewCustomer($email);
}
$this->addMailchimpData($email);
$customer->setSubscribedToNewsletter(true);
$this->customerManager->flush();
}
in
vendor/bitbag/mailchimp-plugin/src/EventListener/CustomerNewsletterListener.php
->
subscribe
(line 77)
}
private function subscribe(CustomerInterface $customer): void
{
if (null !== $customer->getEmail()) {
$this->newsletterSubscriptionHandler->subscribe($customer->getEmail());
}
}
private function unsubscribe(CustomerInterface $customer): void
{
in
vendor/bitbag/mailchimp-plugin/src/EventListener/CustomerNewsletterListener.php
->
subscribe
(line 44)
$customer,
CustomerInterface::class
);
}
$customer->isSubscribedToNewsletter() === false ? $this->unsubscribe($customer) : $this->subscribe($customer);
}
public function customerPostUpdateEvent(GenericEvent $event): void
{
$this->customerCreateEvent($event);
in
vendor/symfony/event-dispatcher/Debug/WrappedListener.php
->
customerCreateEvent
(line 118)
$this->priority = $dispatcher->getListenerPriority($eventName, $this->listener);
$e = $this->stopwatch->start($this->name, 'event_listener');
try {
($this->optimizedListener ?? $this->listener)($event, $eventName, $dispatcher);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
__invoke
(line 230)
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
in
vendor/symfony/event-dispatcher/EventDispatcher.php
->
callListeners
(line 59)
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
in
vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php
->
dispatch
(line 154)
try {
$this->beforeDispatch($eventName, $event);
try {
$e = $this->stopwatch->start($eventName, 'section');
try {
$this->dispatcher->dispatch($event, $eventName);
} finally {
if ($e->isStarted()) {
$e->stop();
}
}
in
vendor/sylius/resource-bundle/src/Bundle/Controller/EventDispatcher.php
->
dispatch
(line 80)
): ResourceControllerEvent {
$eventName = $requestConfiguration->getEvent() ?: $eventName;
$metadata = $requestConfiguration->getMetadata();
$event = new ResourceControllerEvent($resource);
$this->eventDispatcher->dispatch($event, sprintf('%s.%s.post_%s', $metadata->getApplicationName(), $metadata->getName(), $eventName));
return $event;
}
public function dispatchInitializeEvent(
in
vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceController.php
->
dispatchPostEvent
(line 202)
if ($configuration->isHtmlRequest()) {
$this->flashHelper->addSuccessFlash($configuration, ResourceActions::CREATE, $newResource);
}
$postEvent = $this->eventDispatcher->dispatchPostEvent(ResourceActions::CREATE, $configuration, $newResource);
if (!$configuration->isHtmlRequest()) {
return $this->createRestView($configuration, $newResource, Response::HTTP_CREATED);
}
in
vendor/symfony/http-kernel/HttpKernel.php
->
createAction
(line 163)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 75)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 202)
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
Logs
No log messages
Stack Trace
BadRequestHttpException
|
---|
Symfony\Component\HttpKernel\Exception\BadRequestHttpException: Response status is 400 instead of subscribed at vendor/bitbag/mailchimp-plugin/src/Handler/NewsletterSubscriptionHandler.php:148 at BitBag\SyliusMailChimpPlugin\Handler\NewsletterSubscriptionHandler->exportNewEmail() (vendor/bitbag/mailchimp-plugin/src/Handler/NewsletterSubscriptionHandler.php:185) at BitBag\SyliusMailChimpPlugin\Handler\NewsletterSubscriptionHandler->addMailchimpData() (vendor/bitbag/mailchimp-plugin/src/Handler/NewsletterSubscriptionHandler.php:66) at BitBag\SyliusMailChimpPlugin\Handler\NewsletterSubscriptionHandler->subscribe() (vendor/bitbag/mailchimp-plugin/src/EventListener/CustomerNewsletterListener.php:77) at BitBag\SyliusMailChimpPlugin\EventListener\CustomerNewsletterListener->subscribe() (vendor/bitbag/mailchimp-plugin/src/EventListener/CustomerNewsletterListener.php:44) at BitBag\SyliusMailChimpPlugin\EventListener\CustomerNewsletterListener->customerCreateEvent() (vendor/symfony/event-dispatcher/Debug/WrappedListener.php:118) at Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke() (vendor/symfony/event-dispatcher/EventDispatcher.php:230) at Symfony\Component\EventDispatcher\EventDispatcher->callListeners() (vendor/symfony/event-dispatcher/EventDispatcher.php:59) at Symfony\Component\EventDispatcher\EventDispatcher->dispatch() (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154) at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch() (vendor/sylius/resource-bundle/src/Bundle/Controller/EventDispatcher.php:80) at Sylius\Bundle\ResourceBundle\Controller\EventDispatcher->dispatchPostEvent() (vendor/sylius/resource-bundle/src/Bundle/Controller/ResourceController.php:202) at Sylius\Bundle\ResourceBundle\Controller\ResourceController->createAction() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:75) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:202) at Symfony\Component\HttpKernel\Kernel->handle() (public/index.php:25) |