From b46013898d5bf4ca31eaf88d0ebb47e52b2da011 Mon Sep 17 00:00:00 2001 From: pjohans Date: Fri, 11 Sep 2015 13:16:02 +0200 Subject: [PATCH] Issue 378 by Pjohans: Avoid page crash when infomedia delivers wrong answer --- ting_infomedia.wrapper.inc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ting_infomedia.wrapper.inc b/ting_infomedia.wrapper.inc index 34896ba..8071c41 100644 --- a/ting_infomedia.wrapper.inc +++ b/ting_infomedia.wrapper.inc @@ -13,7 +13,7 @@ function ting_infomedia_get_article($id) { $factory = ting_get_request_factory(); } catch( TingClientException $e ) { - watchdog($e->message); + watchdog($e->getMessage()); } $request = $factory->getInfomediaArticleRequest(); @@ -21,7 +21,13 @@ function ting_infomedia_get_article($id) { $request->setFaust($id); ting_infomedia_add_user_creds($request); - $ret = $request->parse(ting_execute($request->getRequest())); + try { + $ret = $request->parse(ting_execute($request->getRequest())); + } + catch(TingClientException $e){ + watchdog('infomedia', $e->getMessage(),array(), WATCHDOG_ERROR); + } + return $ret; }