forked from platypush/platypush
s/logger/_logger/
in the plugins
module.
The `logger` name may clash with the context of an action, where `logger` may have been set to something else.
This commit is contained in:
parent
1cb686bdab
commit
69706eaabe
1 changed files with 2 additions and 2 deletions
|
@ -15,7 +15,7 @@ from platypush.message.response import Response
|
||||||
from platypush.utils import get_decorators, get_plugin_name_by_class
|
from platypush.utils import get_decorators, get_plugin_name_by_class
|
||||||
|
|
||||||
PLUGIN_STOP_TIMEOUT = 5 # Plugin stop timeout in seconds
|
PLUGIN_STOP_TIMEOUT = 5 # Plugin stop timeout in seconds
|
||||||
logger = logging.getLogger(__name__)
|
_logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def action(f: Callable[..., Any]) -> Callable[..., Response]:
|
def action(f: Callable[..., Any]) -> Callable[..., Response]:
|
||||||
|
@ -33,7 +33,7 @@ def action(f: Callable[..., Any]) -> Callable[..., Response]:
|
||||||
try:
|
try:
|
||||||
result = f(*args, **kwargs)
|
result = f(*args, **kwargs)
|
||||||
except TypeError as e:
|
except TypeError as e:
|
||||||
logger.exception(e)
|
_logger.exception(e)
|
||||||
result = Response(errors=[str(e)])
|
result = Response(errors=[str(e)])
|
||||||
|
|
||||||
if result and isinstance(result, Response):
|
if result and isinstance(result, Response):
|
||||||
|
|
Loading…
Reference in a new issue