| Conditions | 4 |
| Total Lines | 14 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | # -*- coding: utf-8 -*- |
||
| 34 | def error_handle(func): |
||
| 35 | def wrapper(self, *args, **kwargs): |
||
| 36 | if not self.school.use_ex_handle: |
||
| 37 | return func(self, *args, **kwargs) |
||
| 38 | else: |
||
| 39 | try: |
||
| 40 | return func(self, *args, **kwargs) |
||
| 41 | |||
| 42 | except LoginException as reqe: |
||
| 43 | return LoginFail(reqe) |
||
| 44 | |||
| 45 | except SchoolException as reqe: |
||
| 46 | return {'error': reqe}
|
||
| 47 | return wrapper |
||
| 48 | |||
| 62 |
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.