Skip to content

Commit 72bb062

Browse files
committed
Throwing exception
1 parent 23326c4 commit 72bb062

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Optimizely/Event/Dispatcher/CurlEventDispatcher.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
namespace Optimizely\Event\Dispatcher;
1919

20+
use Exception;
2021
use Optimizely\Event\LogEvent;
2122

2223
/**
@@ -35,6 +36,10 @@ public function dispatchEvent(LogEvent $event)
3536
}
3637
$cmd.= " -d '".json_encode($event->getParams())."'";
3738
$cmd.= " '".$event->getUrl()."' > /dev/null 2>&1 &";
38-
exec($cmd);
39+
exec($cmd, $output, $exit_code);
40+
41+
if ($exit_code !== 0) {
42+
throw new Exception('Curl command failed.');
43+
}
3944
}
4045
}

0 commit comments

Comments
 (0)