Adding attachment exception handler around get_filename.