def from_string(filedata): try: return Image.from_buffer(filedata) except SanperaError: log_exc(level=logging.DEBUG) raise WeasylError('imageDecodeError')
def from_string(filedata): try: return Image.from_buffer(filedata) except SanperaError as e: capture_exception(e, level='info') raise WeasylError('imageDecodeError') from e