-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor/next method #312
Refactor/next method #312
Conversation
kyvg
commented
Feb 16, 2024
•
edited
Loading
edited
- перенёс всю логику с отправкой сообщений в battle log в BaseAction,
- сделал единый формат для сообщений, убрав копипасту и бесконечные MagicNext, PhysNext...
- сделал единое форматирование сообщений с уроном
f2c9d12
to
9c180f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 норм порефачил, но меня пугает handleError, который станет прям мусоркой.
if (error instanceof CastError) { | ||
this.params.game.recordOrderResult(this.getFailResult(error.reason)); | ||
} else { | ||
console.error(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вот сюда будут сваливаться кучей все error, и потом не найдем откуда
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так наоборот же теперь легко найти по stack trace будет. Раньше все ошибки летели в logger и там просто выводилось сообщение 'Ошибка парсинга строки магии'. И нигде ты их найти не мог, в консоль они не выводились, т.к. типа "обработанные" были.
Сейчас в logger будут лететь только CastError, а остальные выводиться в консоль вместе со всем stack trace. Можно дополнительно 'Ошибка парсинга строки магии' выводить, если хотим сразу видеть, что что-то сломалось
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Может какой то маркер придумать? Мб в id admin канала слать или что-то в этом роде?