From 4b280090fc8c1ac48858daad6e300dd49a83ef24 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 22 Jul 2013 20:31:52 -0400 Subject: [PATCH] Better debugging info for library errors --- chrome/content/zotero/xpcom/data/libraries.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/libraries.js b/chrome/content/zotero/xpcom/data/libraries.js index b5acc583e..a38255204 100644 --- a/chrome/content/zotero/xpcom/data/libraries.js +++ b/chrome/content/zotero/xpcom/data/libraries.js @@ -36,7 +36,7 @@ Zotero.Libraries = new function () { break; default: - throw ("Invalid library type '" + type + "' in Zotero.Libraries.add()"); + throw new Error("Invalid library type '" + type + "' in Zotero.Libraries.add()"); } var sql = "INSERT INTO libraries (libraryID, libraryType) VALUES (?, ?)"; @@ -57,7 +57,7 @@ Zotero.Libraries = new function () { return group.name; default: - throw ("Unsupported library type '" + type + "' in Zotero.Libraries.getName()"); + throw new Error("Unsupported library type '" + type + "' in Zotero.Libraries.getName()"); } } @@ -69,7 +69,7 @@ Zotero.Libraries = new function () { var sql = "SELECT libraryType FROM libraries WHERE libraryID=?"; var libraryType = Zotero.DB.valueQuery(sql, libraryID); if (!libraryType) { - throw ("Library " + libraryID + " does not exist in Zotero.Libraries.getType()"); + throw new Error("Library " + libraryID + " does not exist in Zotero.Libraries.getType()"); } return libraryType; } @@ -87,7 +87,7 @@ Zotero.Libraries = new function () { return group.editable; default: - throw ("Unsupported library type '" + type + "' in Zotero.Libraries.getName()"); + throw new Error("Unsupported library type '" + type + "' in Zotero.Libraries.getName()"); } } @@ -104,7 +104,7 @@ Zotero.Libraries = new function () { return group.filesEditable; default: - throw ("Unsupported library type '" + type + "' in Zotero.Libraries.getName()"); + throw new Error("Unsupported library type '" + type + "' in Zotero.Libraries.getName()"); } } }