From 4ecd78d6a8932d5bd0c78c0ec95bc99d71e35342 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Tue, 17 Sep 2024 04:49:49 -0400 Subject: [PATCH] perf: remove error raise when command handler return an unexpected value --- model/command/manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/model/command/manager.py b/model/command/manager.py index f6e90290c..063f1514a 100644 --- a/model/command/manager.py +++ b/model/command/manager.py @@ -124,8 +124,11 @@ class CommandManager(): else: command_result = handler(message_event, context) - if not isinstance(command_result, CommandResult): - raise ValueError(f"Command {command} handler should return CommandResult.") + # if not isinstance(command_result, CommandResult): + # raise ValueError(f"Command {command} handler should return CommandResult.") + + if not command_result: + return context.metrics_uploader.command_stats[command] += 1