Commit 9960f62f authored by Marco Boretto's avatar Marco Boretto

Merge pull request #81 from noplanman/code_cleanup_TelegramException

Code cleanup for TelegramException.php
parents 998983dd ed670a9d
<?php <?php
/* /**
* This file is part of the TelegramBot package. * This file is part of the TelegramBot package.
* *
* (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com> * (c) Avtandil Kikabidze aka LONGMAN <akalongman@gmail.com>
* *
* For the full copyright and license information, please view the LICENSE * For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code. * file that was distributed with this source code.
*/ */
namespace Longman\TelegramBot\Exception; namespace Longman\TelegramBot\Exception;
/**
* Main exception class used for exception handling
*/
class TelegramException extends \Exception class TelegramException extends \Exception
{ {
/**
* Exception constructor that writes the exception message to the logfile
*
* @param string $message Error message
* @param integer $code Error code
*/
public function __construct($message, $code = 0) public function __construct($message, $code = 0)
{ {
parent::__construct($message, $code); parent::__construct($message, $code);
...@@ -19,9 +28,8 @@ class TelegramException extends \Exception ...@@ -19,9 +28,8 @@ class TelegramException extends \Exception
$path = 'TelegramException.log'; $path = 'TelegramException.log';
$status = file_put_contents( $status = file_put_contents(
$path, $path,
date('Y-m-d H:i:s', time()) .' '. self::__toString() . "\n", date('Y-m-d H:i:s', time()) . ' ' . self::__toString() . "\n",
FILE_APPEND FILE_APPEND
); );
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment