Skip to content

Commit

Permalink
Improve error message for bad key
Browse files Browse the repository at this point in the history
  • Loading branch information
egh committed Dec 6, 2017
1 parent 80d907e commit 2c2931c
Show file tree
Hide file tree
Showing 2 changed files with 3 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 @@ -68,7 +68,7 @@ function item2key(item) {
function findByKey(key, zotero) {
let rejectIfUndefined = (item)=>{
if (!item) {
return makeClientError('Item not found.');
return makeClientError(`${key} not found`);
} else {
return item;
}
Expand Down
2 changes: 2 additions & 0 deletions test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def test_items_easykey_bad
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 Expand Up @@ -182,6 +183,7 @@ def test_items_style_param
def test_items_bad_key
resp = @client.get(@item_url, {"key" => "1_ZBZQ4KMXXXX", "format" => "key"})
assert_equal 400, resp.status
assert_equal "1_ZBZQ4KMXXXX not found", resp.body
end

def test_items_multiple_easykeys
Expand Down

0 comments on commit 2c2931c

Please sign in to comment.