From bf4c5c1158ae52b04405ad4eae00f774b24c90ad Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Tue, 10 Jul 2012 02:46:24 -0400 Subject: [PATCH] Zotero.Exception.Alert when an alert title is specified --- chrome/content/zotero/xpcom/error.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/xpcom/error.js b/chrome/content/zotero/xpcom/error.js index 08f8d7b059..99f89a4e59 100644 --- a/chrome/content/zotero/xpcom/error.js +++ b/chrome/content/zotero/xpcom/error.js @@ -78,16 +78,16 @@ Zotero.Exception = {}; Zotero.Exception.Alert = function(name, params, title, cause) { this.name = name; this.params = params || []; - this.title = title || "general.error"; + this._title = title || "general.error"; this.cause = cause; return this; }; Zotero.Exception.Alert.prototype = { get title() { - if(this.title) { + if(this._title) { try { - return Zotero.getString(this.title); + return Zotero.getString(this._title); } catch(e) {} } try { @@ -115,7 +115,11 @@ Zotero.Exception.Alert.prototype = { */ "present":function(window) { Components.utils.import("resource://gre/modules/Services.jsm"); + try { Services.prompt.alert(window || null, this.title, this.toString()); + }catch(e) { + Zotero.debug(e); + } }, /**