Add file object in error event