找出客户查找里的 bug

来自 异常
C# 14 / .NET 10 进阶 4分钟 找出 1处问题

找出为什么真实故障与客户缺失无关时,这个方法仍可能报告客户不存在。

csharp
public async Task<Customer?> FindCustomerAsync(
    string id, CancellationToken token)
{
    try
    {
        return await _store.FindAsync(id, token);
    }
    catch (Exception)
    {
        return null;
    }
}
在试验场中打开
报告错误