azaz-az / holiday-predictor

这是一个假期预测器,预测假期如何调休
GNU General Public License v3.0
7 stars 4 forks source link

🐛 使用 fcls 命令时,若输入意料之外的输入,将会直接报错 #24

Closed azaz-az closed 4 months ago

azaz-az commented 4 months ago

🐛 使用 fcls 命令时,若输入意料之外的输入,将会直接报错

例如:

Holiday Predictor / 假期预测器 - 基于 Python 的调休预测工具
键入 help 以查看帮助。
> fcls abc def sdge
Traceback (most recent call last):
  File "C:\Users\a233d\Documents\git\holiday-predictor\__main__.py", line 49, in <module>
    print(calculation_forecast_list(input_list))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\a233d\Documents\git\holiday-predictor\main.py", line 104, in calculation_forecast_list
    start_year: int = int(given_list[1])
                      ^^^^^^^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: 'abc'

进程已结束,退出代码为 1

应当加入 try 以解决这个问题

azaz-az commented 4 months ago

已在 v0.13.0-alpha.1 版本中修复此 bug.