protect file discover operation with try-except block