Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Commit

Permalink
change ignore ips condition place for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
Karim Elshendy committed Oct 7, 2015
1 parent de69b85 commit 01828a8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Listener/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ public function onKernelException(GetResponseForExceptionEvent $event)
$exception = $event->getException();

if ($exception instanceof HttpException) {
if (!in_array($event->getRequest()->getClientIp(), $this->ignoredIPs) && (500 === $exception->getStatusCode() || (404 === $exception->getStatusCode() && true === $this->handle404) || (in_array($exception->getStatusCode(), $this->handleHTTPcodes)))) {
if (in_array($event->getRequest()->getClientIp(), $this->ignoredIPs)) {
return;
}

if (500 === $exception->getStatusCode() || (404 === $exception->getStatusCode() && true === $this->handle404) || (in_array($exception->getStatusCode(), $this->handleHTTPcodes))) {
$this->createMailAndSend($exception, $event->getRequest());
}
} else {
Expand Down

0 comments on commit 01828a8

Please sign in to comment.