Exception handling on file base