C#C
C#3y ago
fasadin

✅ Exception is caught, but not?

I have this piece of code

        try
        {
            await _dbContext.RunningTotals.AddAsync(new RunningTotal
            {
                Value = runningTotalDto.Value
            });

            await _dbContext.SaveChangesAsync();
            
            return new Result<OptionNone>(OptionNone.Default);
        }
        catch (Exception e)
        {
            return new Result<OptionNone>(e);
        }


on await _dbContext.SaveChangesAsync(); I am getting exception. Breakpoint hits catch (Exception e) it goes into return new Result<OptionNone>(e); and then it just skips execution... it shows on IDE that exception is still present

I don't understand nothing from it 😦
Was this page helpful?