From 20a97488d90a23be266af0d198c5330c8ec97912 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Fri, 12 Feb 2016 13:43:15 +0530 Subject: [PATCH] package: Proper string casting of PackageException --- plinth/package.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plinth/package.py b/plinth/package.py index 75a8bfca0..5342d9f23 100644 --- a/plinth/package.py +++ b/plinth/package.py @@ -46,6 +46,11 @@ class PackageException(Exception): self.error_string = error_string self.error_details = error_details + def __str__(self): + """Return the strin representation of the exception.""" + return 'PackageException(error_string="{0}", error_details="{1}")' \ + .format(self.error_string, self.error_details) + class Transaction(object): """Information about an ongoing transaction."""