From 895ee2682ea549f18646e247f58622da1ad4f46a Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Tue, 22 Aug 2006 17:23:10 +0000 Subject: [PATCH] Bug 349598: remove unnecessary dumps, r=dietrich --- .../urlformatter/src/nsURLFormatter.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/toolkit/components/urlformatter/src/nsURLFormatter.js b/toolkit/components/urlformatter/src/nsURLFormatter.js index ea0aafe6c13..340634f7c7f 100644 --- a/toolkit/components/urlformatter/src/nsURLFormatter.js +++ b/toolkit/components/urlformatter/src/nsURLFormatter.js @@ -113,7 +113,7 @@ nsURLFormatterService.prototype = { return repl[aKey]; if (_this._defaults[aKey]) // supported defaults return _this._defaults[aKey](); - dump(aKey + " not found"); + Components.utils.reportError("formatURL: Couldn't find value for key: " + aKey); return ''; } return aFormat.replace(/%([A-Z]+)%/gi, replacer); @@ -126,16 +126,20 @@ nsURLFormatterService.prototype = { var format = null; var PS = Cc['@mozilla.org/preferences-service;1']. getService(Ci.nsIPrefBranch); + try { format = PS.getComplexValue(aPref, Ci.nsIPrefLocalizedString).data; - } catch(ex) { dump(ex + "\n"); } + } catch(ex) {} + if (!format) { - format = PS.getComplexValue(aPref, Ci.nsISupportsString).data; - } - if (!format) { - dump(aPref + " not found"); - return 'about:blank'; + try { + format = PS.getComplexValue(aPref, Ci.nsISupportsString).data; + } catch(ex) { + Components.utils.reportError("formatURLPref: Couldn't get pref: " + aPref); + return "about:blank"; + } } + return this.formatURL(format, aVars); },