From e2a9dc619a0973fbb75b0e36c05c8aae80197e45 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 git-svn-id: svn://10.0.0.236/trunk@208097 18797224-902f-48f8-a5cc-f745e15eee43 --- .../urlformatter/src/nsURLFormatter.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/mozilla/toolkit/components/urlformatter/src/nsURLFormatter.js b/mozilla/toolkit/components/urlformatter/src/nsURLFormatter.js index ea0aafe6c13..340634f7c7f 100644 --- a/mozilla/toolkit/components/urlformatter/src/nsURLFormatter.js +++ b/mozilla/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); },