mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-23 15:06:53 +00:00
[index] Throw exception if no items received
This adds an exception if no items were returned by the bridge. It might indicate a broken bridge or invalid input parameter.
This commit is contained in:
parent
6e4bc341b7
commit
6f6aaa3aec
@ -168,7 +168,12 @@ try {
|
|||||||
// Data transformation
|
// Data transformation
|
||||||
try {
|
try {
|
||||||
$format = Format::create($format);
|
$format = Format::create($format);
|
||||||
$format->setItems($bridge->getItems());
|
$items = $bridge->getItems();
|
||||||
|
if(empty($items)){
|
||||||
|
throw new Exception('No results for this query', 503);
|
||||||
|
}
|
||||||
|
|
||||||
|
$format->setItems($items);
|
||||||
$format->setExtraInfos($bridge->getExtraInfos());
|
$format->setExtraInfos($bridge->getExtraInfos());
|
||||||
$format->display();
|
$format->display();
|
||||||
} catch(Exception $e){
|
} catch(Exception $e){
|
||||||
|
Loading…
Reference in New Issue
Block a user