Skip to content

Commit

Permalink
Improve error message for bad easykey
Browse files Browse the repository at this point in the history
  • Loading branch information
egh committed Dec 6, 2017
1 parent 4f8e2ab commit 80d907e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion extension/content/modules/Core.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
});
}
Expand Down
5 changes: 5 additions & 0 deletions test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 80d907e

Please sign in to comment.