Hello. I execute a request from PHP to TwitterAPI and if it returns me an error like "You have already favorited this status", then the script ends there. I tried to handle the error in order to skip it, like this:

try { $myTweet->like($twit->id); } catch (OAuthException $e) { } 

But the error still stops the script. This script is not mine, if the problem is not due to the Twitter API, then just let me know

  • if the script stops working, then you catch the wrong exception class, no? - teran
  • I tried and Exception to catch, the same thing - Operator
  • Well, inside like () looked? maybe there through die () completion is implemented, and you are trying to catch it ... - AlexandrX
  • OAuthException is an authorization error, and you get an error after. Try catching \ Exception or \ Throwable - ilyaplot

0