2011-02-26 17:15:50 +00:00
|
|
|
<?php
|
2012-10-17 14:28:05 -04:00
|
|
|
|
2020-08-10 17:11:55 -04:00
|
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
|
|
2011-02-26 17:15:50 +00:00
|
|
|
/**
|
|
|
|
|
* HttpProxyController
|
|
|
|
|
*/
|
|
|
|
|
class PMException extends Exception
|
|
|
|
|
{
|
2012-10-17 14:28:05 -04:00
|
|
|
|
2020-08-10 17:11:55 -04:00
|
|
|
public function __construct($message, $code = 0, $previous = null)
|
2012-10-17 14:28:05 -04:00
|
|
|
{
|
2020-08-10 17:11:55 -04:00
|
|
|
parent::__construct($message, 1);
|
2011-02-26 17:15:50 +00:00
|
|
|
}
|
|
|
|
|
|
2020-08-10 17:11:55 -04:00
|
|
|
public function __toString()
|
2012-10-17 14:28:05 -04:00
|
|
|
{
|
2011-02-26 17:15:50 +00:00
|
|
|
return __CLASS__ . ": [{$this->code}]: {$this->message}\n";
|
|
|
|
|
}
|
2016-07-27 16:37:21 -04:00
|
|
|
|
2020-08-10 17:11:55 -04:00
|
|
|
public static function registerErrorLog($error, $token)
|
|
|
|
|
{
|
|
|
|
|
$message = $error->getMessage();
|
|
|
|
|
$context = [
|
|
|
|
|
'token' => $token
|
|
|
|
|
];
|
|
|
|
|
Log::channel(':ExceptionCron')->error($message, Bootstrap::context($context));
|
2016-07-27 16:37:21 -04:00
|
|
|
}
|
2012-10-17 14:28:05 -04:00
|
|
|
}
|