From 22ad60d07a773dc34d7e551327f3a898ac08ec09 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Tue, 14 Dec 2021 19:15:13 -0700 Subject: [PATCH] throw error when no pixabay results --- src/hollywoo_flixel/AssetMacros.kiss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hollywoo_flixel/AssetMacros.kiss b/src/hollywoo_flixel/AssetMacros.kiss index a0cd809..e91b1fd 100644 --- a/src/hollywoo_flixel/AssetMacros.kiss +++ b/src/hollywoo_flixel/AssetMacros.kiss @@ -43,7 +43,9 @@ (Json.parse (request apiQuery)) imageInfo - (nth result.hits (% resultNumber perPage))] + (if result.hits + (nth result.hits (% resultNumber perPage)) + (throw "No Pixabay results for $searchQuery"))] // Document where the assets came from: (appendToSources searchQuery resultNumber "Pixabay" "${imageInfo.user}:${imageInfo.user_id}" apiQuery) (ReaderExp.StrExp (downloadToImages searchQuery resultNumber "Pixabay" imageInfo.largeImageURL)))