Properly handling HttpClient exceptions within async / await

前端 未结 3 2074
醉梦人生
醉梦人生 2020-12-24 15:12

I was hoping somebody could enlighten me a little bit on an issue I am facing in regards to async/await exception handling with HttpClient. I have written some code to illus

3条回答
  •  执笔经年
    2020-12-24 15:30

    The debugger is telling you that this exception is first chance. When a debugger is attached to your process it gets notified for every exception that is thrown and then based on how the debugger has been configured it will decide what to do with it. You can go through What is first chance exception? for more details.

    On a side note, catch specific exceptions only so that you understand which exceptions you are expecting and why.

提交回复
热议问题