[gnome-documents] embed: use exception.message instead of exception.toString()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-documents] embed: use exception.message instead of exception.toString()
- Date: Tue, 6 Sep 2011 21:30:59 +0000 (UTC)
commit f77c4101374c2500c0e19521b2ea6edf3643b87f
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Sep 6 17:29:55 2011 -0400
embed: use exception.message instead of exception.toString()
Use the exception message to display errors to the user, as it's
slightly less verbose.
src/embed.js | 4 ++--
src/error.js | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/embed.js b/src/embed.js
index 44bf806..09669b5 100644
--- a/src/embed.js
+++ b/src/embed.js
@@ -304,7 +304,7 @@ ViewEmbed.prototype = {
_onQueryError: function(manager, message, exception) {
this._destroyScrollChild();
- let errorBox = new ErrorBox.ErrorBox(message, exception.toString());
+ let errorBox = new ErrorBox.ErrorBox(message, exception.message);
this._scrolledWin.add_with_viewport(errorBox.widget);
},
@@ -355,7 +355,7 @@ ViewEmbed.prototype = {
Global.modeController.setWindowMode(WindowMode.WindowMode.PREVIEW);
- let errorBox = new ErrorBox.ErrorBox(message, exception.toString());
+ let errorBox = new ErrorBox.ErrorBox(message, exception.message);
this._scrolledWin.add_with_viewport(errorBox.widget);
}
};
diff --git a/src/error.js b/src/error.js
index 3e63547..9b89650 100644
--- a/src/error.js
+++ b/src/error.js
@@ -35,14 +35,14 @@ ErrorHandler.prototype = {
addLoadError: function(doc, exception) {
// Translators: %s is the title of a document
let message = _("Unable to load \"%s\" for preview").format(doc.title);
- log('Error caught: ' + message + ' - ' + exception.toString());
+ log('Error caught: ' + message + ' - ' + exception.message);
this.emit('load-error', message, exception);
},
addQueryError: function(exception) {
let message = _("Unable to fetch the list of documents");
- log('Error caught: ' + message + ' - ' + exception.toString());
+ log('Error caught: ' + message + ' - ' + exception.message);
this.emit('query-error', message, exception);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]