diff --git a/Source.php b/Source.php index 5ac0c0d..ca45b0e 100644 --- a/Source.php +++ b/Source.php @@ -55,4 +55,12 @@ abstract class Source { curl_close($curl); return $resp; } + public function check() { + try { + $this->print(); + } catch (Exception $e) { + echo $e->getMessage(); + echo $e->getTraceAsString(); + } + } } diff --git a/english.php b/english.php index 1ee21c5..553602c 100644 --- a/english.php +++ b/english.php @@ -14,16 +14,11 @@ if (PHP_SAPI !== 'cli') { echo '
';
}
-try {
- (new Source\Textadventures())->print();
- (new Source\IFDB())->print();
- (new Source\Dashingdon())->print();
- (new Source\Itch())->print();
- (new Source\Hyperbook())->print();
-} catch (Exception $e) {
- echo $e->getMessage();
- var_dump($e->getTrace());
-}
+(new Source\Textadventures())->check();
+(new Source\IFDB())->check();
+(new Source\Dashingdon())->check();
+(new Source\Itch())->check();
+(new Source\Hyperbook())->check();
if (PHP_SAPI !== 'cli') {
echo '
';
diff --git a/russian.php b/russian.php
index 4e30384..88fb06f 100644
--- a/russian.php
+++ b/russian.php
@@ -14,16 +14,14 @@ if (PHP_SAPI !== 'cli') {
echo '';
}
-try {
- //(new Source\Urq())->print();
- (new Source\Qsp())->print();
- (new Source\Kvester())->print();
- (new Source\Apero())->print();
- (new Source\Instead())->print();
- (new Source\Storymaze())->print();
- (new Source\Hyperbook())->print();
- (new Source\Questbook())->print();
-} catch (Exception $e) {}
+(new Source\Urq())->check();
+(new Source\Qsp())->check();
+(new Source\Kvester())->check();
+(new Source\Apero())->check();
+(new Source\Instead())->check();
+(new Source\Storymaze())->check();
+(new Source\Hyperbook())->check();
+(new Source\Questbook())->check();
if (PHP_SAPI !== 'cli') {
echo '
';