How to ignore an exception in php?

Asked

Viewed 130 times

3

I am consuming a legacy system method that generates scans some Ftps directories and searches for files. However, if it accesses a directory that does not have files, it creates an exception. Is there any way I can use this method, but ignore if it generates this exception? (without changing the original method)

  • 3

    The first option is to get that original code. The second option is to create more code that checks if the directory has files and then run this method in case there are files... hide problems is not option in my view.

  • 3

    You can put his code?

  • Before accessing FTP, check if you have files in the directory...

1 answer

5

Browser other questions tagged

You are not signed in. Login or sign up in order to post.