mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: log action name when handling actions
This commit is contained in:
parent
ca9614f8e3
commit
0936df4ea3
@ -155,7 +155,6 @@ export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
||||
if (data.data.oneofKind === 'actionPing') {
|
||||
const actionName = data.data.actionPing.ping.oneofKind;
|
||||
if (actionName === undefined) {
|
||||
this.core.context.logger.logError('未知的动作名', actionName);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -165,6 +164,7 @@ export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.core.context.logger.logDebug('处理动作', actionName);
|
||||
// eslint-disable-next-line
|
||||
// @ts-ignore
|
||||
const ret = await actionHandler(data.data.actionPing.ping[actionName]);
|
||||
@ -183,7 +183,7 @@ export class LaanaWsServerAdapter implements ILaanaNetworkAdapter {
|
||||
},
|
||||
}), wsClient);
|
||||
} catch (e: any) {
|
||||
this.core.context.logger.logError('处理动作时出现错误', e);
|
||||
this.core.context.logger.logError(`处理动作 ${data.data.oneofKind} 时出现错误`, e);
|
||||
this.checkStateAndReply(LaanaDataWrapper.toBinary({
|
||||
data: {
|
||||
oneofKind: 'actionPong',
|
||||
|
Loading…
x
Reference in New Issue
Block a user