From fc1f73798611287e540c10f27f533471021922da Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 18 Oct 2018 04:34:07 -0400 Subject: [PATCH] Throw proper error for "key must be an 8-character string" error --- chrome/content/zotero/xpcom/attachments.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/attachments.js b/chrome/content/zotero/xpcom/attachments.js index 560873e9b6..2e21ac3cbf 100644 --- a/chrome/content/zotero/xpcom/attachments.js +++ b/chrome/content/zotero/xpcom/attachments.js @@ -1969,8 +1969,8 @@ Zotero.Attachments = new function(){ this.getStorageDirectoryByLibraryAndKey = function (libraryID, key) { if (typeof key != 'string' || !key.match(/^[A-Z0-9]{8}$/)) { - throw ('key must be an 8-character string in ' - + 'Zotero.Attachments.getStorageDirectoryByLibraryAndKey()') + Zotero.debug(key, 1); + throw new Error('key must be an 8-character string'); } var dir = Zotero.getStorageDirectory(); dir.append(key);