(self)
| 409 | return cls(base=base, message=message) |
| 410 | |
| 411 | def __repr__(self): |
| 412 | from couchbase._utils import is_null_or_empty |
| 413 | details = [] |
| 414 | if hasattr(self, '_base') and self._base: |
| 415 | details.append( |
| 416 | "ec={}, category={}".format( |
| 417 | self._base.err(), |
| 418 | self._base.err_category())) |
| 419 | if not is_null_or_empty(self._message): |
| 420 | details.append("message={}".format(self._message)) |
| 421 | else: |
| 422 | details.append("message={}".format(self._base.strerror())) |
| 423 | else: |
| 424 | if not is_null_or_empty(self._message): |
| 425 | details.append(f'message={self._message}') |
| 426 | if self._context: |
| 427 | details.append(f'context={self._context}') |
| 428 | if self._exc_info and 'cinfo' in self._exc_info: |
| 429 | details.append('C Source={0}:{1}'.format(*self._exc_info['cinfo'])) |
| 430 | if self._exc_info and 'inner_cause' in self._exc_info: |
| 431 | details.append('Inner cause={0}'.format(self._exc_info['inner_cause'])) |
| 432 | return "<{}>".format(", ".join(details)) |
| 433 | |
| 434 | def __str__(self): |
| 435 | return self.__repr__() |
no test coverage detected