Pretty errors

This commit is contained in:
Maxim Khomutov 2023-07-24 04:54:36 +03:00
parent a50decb470
commit 6ccbe99d47
2 changed files with 6 additions and 4 deletions

View File

@ -152,8 +152,9 @@ class EventsSystem:
funcs_data.append(fd)
except Exception as e:
# TODO: i18n
self.log.error(f'Error while calling lua event "{event_name}"; In function: "{func_name}"')
self.log.exception(e)
self.log.error(f'Error: "{e}" - while calling lua event "{event_name}" with arguments: {args} - '
f'in function: "{func_name}"')
# self.log.exception(e)
else:
# TODO: i18n
self.log.warning(f"Event {event_name} does not exist, maybe ev.call_lua_event() or MP.Trigger<>Event()?. "

View File

@ -116,8 +116,9 @@ class MP:
funcs_data.append(fd)
except Exception as e:
# TODO: i18n
self.log.error(f'Error while calling lua event "{event_name}"; In function: "{func_name}"')
self.log.exception(e)
self.log.error(f'Error: "{e}" - while calling lua event "{event_name}" with arguments: {args} - '
f'in function: "{func_name}"')
# self.log.exception(e)
else:
# TODO: i18n
self.log.warning(f"Event {event_name} does not exist, maybe ev.call_lua_event() or MP.Trigger<>Event()?. "