mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
3cf19d8656
This pull request applies code style fixes from an analysis carried out by [StyleCI](https://github.styleci.io). --- For more information, click [here](https://github.styleci.io/analyses/8wKwbZ).
30 lines
671 B
PHP
30 lines
671 B
PHP
<?php
|
|
|
|
namespace App\Exceptions;
|
|
|
|
class PrettyPageException extends \Exception
|
|
{
|
|
/**
|
|
* Custom error handler.
|
|
*
|
|
* @param string $message
|
|
* @param int $code
|
|
* @param bool $render Whether to show a error page.
|
|
* @return void
|
|
*/
|
|
public function __construct($message = 'Error occured.', $code = -1, $render = false)
|
|
{
|
|
parent::__construct($message, $code);
|
|
|
|
if ($render) {
|
|
$this->showErrorPage()->send();
|
|
exit;
|
|
}
|
|
}
|
|
|
|
public function showErrorPage()
|
|
{
|
|
return response()->view('errors.pretty', ['code' => $this->code, 'message' => $this->message]);
|
|
}
|
|
}
|