summaryrefslogtreecommitdiff
path: root/obnamlib/structurederror.py
diff options
context:
space:
mode:
Diffstat (limited to 'obnamlib/structurederror.py')
-rw-r--r--obnamlib/structurederror.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/obnamlib/structurederror.py b/obnamlib/structurederror.py
index 81c4d5a4..18c13e5a 100644
--- a/obnamlib/structurederror.py
+++ b/obnamlib/structurederror.py
@@ -123,10 +123,17 @@ class StructuredError(Exception):
formatted_msg = '{0} (PROGRAMMING ERROR: {1} {2})'.format(
dedented, repr(e), repr(self.kwargs))
- return '{0}: {1}'.format(self.id, formatted_msg)
+ formatted = '{0}: {1}'.format(self.id, formatted_msg)
+ return formatted.rstrip()
def formatted(self):
- '''Return the full formatted message.'''
+ '''Return the full formatted message.
+
+ Note that the returned string will NOT end in whitespace. If
+ the format string ends in, say, a newline, it is stripped
+ away.
+
+ '''
return self._format_msg(self.msg)
def __str__(self):