diff --git a/nntmux/Movie.php b/nntmux/Movie.php index 922182a6b..4d62e9972 100755 --- a/nntmux/Movie.php +++ b/nntmux/Movie.php @@ -788,12 +788,12 @@ class Movie try { $buffer = $this->client->get('https://webservice.fanart.tv/v3/movies/' . 'tt' . $imdbId . '?api_key=' . $this->fanartapikey)->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } @@ -954,12 +954,12 @@ class Movie ] )->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } @@ -1175,12 +1175,12 @@ class Movie '&r=json' )->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } @@ -1347,12 +1347,12 @@ class Movie '&as_occt=title&safe=images&tbs=&as_filetype=&as_rights=' )->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } @@ -1393,12 +1393,12 @@ class Movie '&qs=n&form=QBLH&filt=all' )->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } @@ -1447,12 +1447,12 @@ class Movie urlencode('www.imdb.com/title/') )->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } diff --git a/nntmux/ReleaseImage.php b/nntmux/ReleaseImage.php index c3595f208..3090178df 100755 --- a/nntmux/ReleaseImage.php +++ b/nntmux/ReleaseImage.php @@ -98,12 +98,12 @@ class ReleaseImage try { $img = $this->client->get($imgLoc)->getBody()->getContents(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); } diff --git a/nntmux/RequestID.php b/nntmux/RequestID.php index f0ed9e13c..346e28bdf 100755 --- a/nntmux/RequestID.php +++ b/nntmux/RequestID.php @@ -25,6 +25,11 @@ abstract class RequestID */ public $groups; + /** + * @var Client + */ + public $client; + /** * @param array $options Class instances / Echo to cli? */ diff --git a/nntmux/RequestIDWeb.php b/nntmux/RequestIDWeb.php index 8c2352c40..449b6a4f4 100755 --- a/nntmux/RequestIDWeb.php +++ b/nntmux/RequestIDWeb.php @@ -164,12 +164,12 @@ class RequestIDWeb extends RequestID ); $returnXml = $request->xml(); } catch (ClientException $e) { - if(NN_DEBUG) { + if(NN_DEBUG && !empty($e)) { echo Psr7\str($e->getRequest()); echo Psr7\str($e->getResponse()); } } catch (ServerException $se) { - if (NN_DEBUG) { + if (NN_DEBUG && !empty($se)) { echo Psr7\str($se->getRequest()); echo Psr7\str($se->getResponse()); }