2002-feb24-net / 2002-feb24-net/morgan-project0

Add exception handling to ensure users can't enter non-integers

未关闭 适合新手
#1 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug
主要语言
C#
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

Add an exception that will stop the system from breaking when a non-integer is entered into the console.

https://github.com/2002-feb24-net/morgan-project0/blob/c13bac5a6d6e3b2856925f7d5539c685c8b9afa0/InstrumentStore.Library/Model/Customer.cs#L125

贡献指南

这个仓库没有索引到贡献指南

调研方向

该 issue 指向 InstrumentStore.Library/Model/Customer.cs 中的第 125 行。首先检查该文件,了解当前如何处理用户输入。查找一个读取控制台输入并将其解析为整数的方法。添加 try-catch 块或使用 int.TryParse 来验证输入,并提供有帮助的错误消息。运行控制台应用程序并输入非整数值进行测试,以确保系统不再崩溃。

由索引模型根据 Issue 内容生成。

评估

领域
backend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。