diff options
Diffstat (limited to 'app/class')
-rw-r--r-- | app/class/Config.php | 16 | ||||
-rw-r--r-- | app/class/Controlleruser.php | 7 | ||||
-rw-r--r-- | app/class/Media.php | 3 | ||||
-rw-r--r-- | app/class/User.php | 3 |
4 files changed, 21 insertions, 8 deletions
diff --git a/app/class/Config.php b/app/class/Config.php index 37321e4..c7d1a78 100644 --- a/app/class/Config.php +++ b/app/class/Config.php @@ -2,8 +2,6 @@ namespace Wcms; -use Http\Client\Common\Plugin\RetryPlugin; - abstract class Config { protected static $pagetable = 'mystore'; @@ -35,6 +33,8 @@ abstract class Config protected static $bookmark = []; protected static $secretkey = null; protected static $sentrydsn = ''; + /** @var string|false $debug */ + protected static $debug = false; public const SECRET_KEY_MIN = 16; public const SECRET_KEY_MAX = 128; @@ -271,6 +271,11 @@ abstract class Config return self::$sentrydsn; } + public static function debug() + { + return self::$debug; + } + // __________________________________________ S E T ______________________________________ @@ -469,6 +474,13 @@ abstract class Config } } + public static function setdebug($debug) + { + if (is_string($debug)) { + self::$debug = $debug; + } + } + diff --git a/app/class/Controlleruser.php b/app/class/Controlleruser.php index 53cf9b9..0345434 100644 --- a/app/class/Controlleruser.php +++ b/app/class/Controlleruser.php @@ -2,8 +2,7 @@ namespace Wcms; -use Exception; -use Throwable; +use RuntimeException; class Controlleruser extends Controller { @@ -38,7 +37,7 @@ class Controlleruser extends Controller $user = $this->usermanager->get($this->user); try { $user->hydrateexception($_POST); - } catch (\Throwable $th) { + } catch (RuntimeException $th) { Model::sendflashmessage('There was a problem when updating preference : ' . $th->getMessage(), 'error'); } if ($_POST['passwordhash']) { @@ -63,7 +62,7 @@ class Controlleruser extends Controller $user = $usermanager->get($_POST['user']); $user->addbookmark($bookmark); $usermanager->add($user); - } catch (Throwable $th) { + } catch (RuntimeException $th) { Logger::errorex($th, true); Model::sendflashmessage('Error while creating bookmark : ' . $th->getMessage(), 'error'); } diff --git a/app/class/Media.php b/app/class/Media.php index 099d4f8..3a34a04 100644 --- a/app/class/Media.php +++ b/app/class/Media.php @@ -267,7 +267,8 @@ class Media extends Item $timestamp = filemtime($this->getfulldir()); try { $this->date = new DateTimeImmutable("@$timestamp"); - } catch (\Throwable $th) { + } catch (Exception $e) { + Logger::warningex($e); $this->date = new DateTimeImmutable(); } } diff --git a/app/class/User.php b/app/class/User.php index b2b6193..efd89ae 100644 --- a/app/class/User.php +++ b/app/class/User.php @@ -4,6 +4,7 @@ namespace Wcms; use DateTimeImmutable; use DateTimeZone; +use RuntimeException; class User extends Item { @@ -203,7 +204,7 @@ class User extends Item function ($datas) { try { return new Bookmark($datas); - } catch (\Throwable $th) { + } catch (RuntimeException $e) { return false; } }, |