Context Managers¶
danling.utils.context_managers
¶
debug
¶
Python
debug(enable: bool = True, error: Exceptions = Exception, exclude: Optional[Exceptions] = None)
Contextmanager to enter debug mode on error except for exclude.
debug is intended to be used to catch the error and enter debug mode.
Since it is mainly for development purposed, we include an enable args so that it can be deactivated.
参数:
| 名称 | 类型 | 描述 | 默认 |
|---|---|---|---|
|
bool
|
Whether to enable the contextmanager.
Defaults to |
True
|
|
Exceptions
|
The error to catch.
Defaults to |
Exception
|
|
Optional[Exceptions]
|
The error to exclude.
Defaults to |
None
|