Bug 752958 - Don't assume self.message is a str, a=test-only
authorJonathan Griffin <jgriffin@mozilla.com>
Tue, 08 May 2012 10:01:01 -0700
changeset 95775 9803383567bdd5524a99de6bad4889c6c1f2e3f2
parent 95774 69b20b2d47f15d42a40d5e3e60f004071e7028de
child 95776 24cf58c37749ad8dce80c84976ede5b067b545f6
push id1439
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 20:19:22 +0000
treeherdermozilla-aurora@ea74834dccd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstest-only
bugs752958
milestone15.0a1
Bug 752958 - Don't assume self.message is a str, a=test-only
testing/marionette/client/marionette/errors.py
--- a/testing/marionette/client/marionette/errors.py
+++ b/testing/marionette/client/marionette/errors.py
@@ -39,20 +39,20 @@ class MarionetteException(Exception):
 
     def __init__(self, message=None, status=500, stacktrace=None):
         self.message = message
         self.status = status
         self.stacktrace = stacktrace
 
     def __str__(self):
         if self.stacktrace:
-            return '%s\nstacktrace:\n%s' % (self.message,
+            return '%s\nstacktrace:\n%s' % (str(self.message),
                 ''.join(['\t%s\n' % x for x in self.stacktrace.split('\n')]))
         else:
-            return self.message
+            return str(self.message)
 
 class TimeoutException(MarionetteException):
     pass
 
 class JavascriptException(MarionetteException):
     pass
 
 class NoSuchElementException(MarionetteException):