Answer the question
In order to leave comments, you need to log in
How to catch error in laravel and handle it?
I connected a third-party script to laravel via macro. The script connects to a specific ip via fsockopen and then I perform some actions. The fact is that if the ip is not available, I will get an error:
ErrorException in Websend.php line 35:
fsockopen():
Answer the question
In order to leave comments, you need to log in
From documentation.
fsockopen() returns a file pointer that can be passed to file functions (such as fgets(), fgetss(), fwrite(), fclose(), and feof()). If the call fails, the function will return FALSE.
You can also use the errno and errstr parameters.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question