Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Report or log an exception.
- *
- * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
- *
- * @param \Exception $exception
- * @return void
- */
- public function report(Exception $exception)
- {
- if (!$this->shouldntReport($exception)) {
- $message = $exception->getMessage() . '(' . $exception->getCode() . ')';
- $message .= ' => ' . $exception->getFile() . ':' . $exception->getline();
- $data = "payload=" . json_encode(array(
- "channel" => "#error_notifications",
- "text" => $message,
- "username" => 'Pemberi tahu',
- "icon_url" => 'https://media.giphy.com/media/LF8plQNlgYwnK/giphy.gif'
- ));
- $ch = curl_init("WebHook URL");
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $result = curl_exec($ch);
- curl_close($ch);
- }
- parent::report($exception);
- }
Advertisement
Add Comment
Please, Sign In to add comment