| Conditions | 1 |
| Total Lines | 13 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | from hapic.error import DefaultErrorBuilder |
||
| 12 | def build_from_exception( |
||
| 13 | self, |
||
| 14 | exception: Exception, |
||
| 15 | include_traceback: bool = False, |
||
| 16 | ) -> dict: |
||
| 17 | error_dict = DefaultErrorBuilder.build_from_exception( |
||
| 18 | self, |
||
| 19 | exception, |
||
| 20 | include_traceback |
||
| 21 | ) |
||
| 22 | code = getattr(exception, 'error_code', None) |
||
| 23 | error_dict['code'] = code |
||
| 24 | return error_dict |
||
| 25 | |||
| 33 |