From 27fad6d2af530376d327327e0b53a73814702a04 Mon Sep 17 00:00:00 2001 From: logmanoriginal Date: Fri, 28 Jul 2017 22:45:52 +0200 Subject: [PATCH] [index] Clarify error message during data transformation An empty list of items should not throw an exception as this is technically still a valid feed (just empty). Instead the error message should focus on actual transformation errors. --- index.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/index.php b/index.php index 9bb04bb7..6954bbf3 100644 --- a/index.php +++ b/index.php @@ -197,12 +197,7 @@ EOD; // Data transformation try { $format = Format::create($format); - $items = $bridge->getItems(); - if(empty($items)){ - throw new Exception('No results for this query', 503); - } - - $format->setItems($items); + $format->setItems($bridge->getItems()); $format->setExtraInfos($bridge->getExtraInfos()); $format->display(); } catch(Exception $e){ @@ -217,7 +212,7 @@ EOD; . $bridge->getMaintainer(); $message = <<getName()} was unable to receive or process the remote website's content. +RSS-Bridge was unable to transform the contents returned by {$bridge->getName()}! Check your input parameters or press F5 to retry. Use the following link to notify the bridge maintainer if this error persists: @@ -233,6 +228,7 @@ EOD; header('Content-Type: text/plain'); die($message); } + die; } }