diff --git a/extension/content/modules/Core.jsm b/extension/content/modules/Core.jsm index 90c7355..caabba0 100644 --- a/extension/content/modules/Core.jsm +++ b/extension/content/modules/Core.jsm @@ -194,7 +194,7 @@ function findByEasyKey(key, zotero) { } else if (items.length > 1) { return makeClientError(`${key} returned multiple items`); } else { - return makeClientError('search failed to return a single item'); + return makeClientError(`${key} had no results`); } }); } diff --git a/test/test.rb b/test/test.rb index 1d9b872..f8d6170 100644 --- a/test/test.rb +++ b/test/test.rb @@ -119,6 +119,11 @@ def test_items_easykey_ambiguous assert_equal "doe:2005ambiguous returned multiple items", resp.body end + def test_items_easykey_bad + resp = @client.get(@item_url, {"easykey" => "doe:2005foobar"}) + assert_equal 400, resp.status + assert_equal "doe:2005foobar had no results", resp.body + end def test_betterbibtexkey resp = @client.get(@item_url, {"betterbibtexkey" => "doe:2005first", "format" => "key"}) assert_equal 200, resp.status