Skip to content

Commit

Permalink
fix(cconfig): cfg 命令找不到配置项时的处理错误
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Jan 12, 2024
1 parent f9a99ee commit 2801451
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/qqbot/cmds/system/cconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ def config_operation(cmd, params):
else:
cfg_mgr.data[cfg_entry_path[0]] = cfg_value
reply = ["[bot]配置项{}修改成功".format(cfg_name)]
except AttributeError:
except KeyError:
reply = ["[bot]err:未找到配置项 {}".format(cfg_name)]
except NameError:
reply = ["[bot]err:配置项{}值不合法(字符串需要使用双引号包裹)".format(cfg_name)]
except ValueError:
reply = ["[bot]err:未找到配置项 {}".format(cfg_name)]

Expand Down

0 comments on commit 2801451

Please sign in to comment.