Catching exceptions from Guzzle

前端 未结 8 1774
情歌与酒
情歌与酒 2020-11-30 22:07

I\'m trying to catch exceptions from a set of tests I\'m running on an API I\'m developing and I\'m using Guzzle to consume the API methods. I\'ve got the tests wrapped in a

8条回答
  •  伪装坚强ぢ
    2020-11-30 22:48

    If the Exception is being thrown in that try block then at worst case scenario Exception should be catching anything uncaught.

    Consider that the first part of the test is throwing the Exception and wrap that in the try block as well.

提交回复
热议问题