-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Description
pysam.SamtoolsError
uses a repr()
in its __str__
method,
Lines 13 to 21 in 55b9c0b
class SamtoolsError(Exception): | |
'''exception raised in case of an error incurred in the samtools | |
library.''' | |
def __init__(self, value): | |
self.value = value | |
def __str__(self): | |
return repr(self.value) |
so I always get an escaped error message in the log file when I except pysam.SamtoolsError as e: logfile.write(str(e))
'samtools returned with error 1: stdout=, stderr=samtools index: failed to create index for "some_broken.bam"\n'
I don't think it's necessary to escape error messages, which makes SamtoolsError behave differently than common python Exceptions.
>>> str(pysam.SamtoolsError("error"))
"'error'"
>>> str(Exception("error"))
'error'
Metadata
Metadata
Assignees
Labels
No labels