<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_object(self, file_path, file_object, error_fct=None):
 """Add a fake file or directory into the filesystem at file_path. Args: file_path: The path to the file to be added relative to self. file_object: File or directory to add. error_class: The error class to be thrown if file_path does not correspond to a directory (used internally( Raises: IOError or OSError: if file_path does not correspond to a directory. """

        error_fct = error_fct or self.raise_os_error
        if not file_path:
            target_directory = self.root
        else:
            target_directory = self.resolve(file_path)
            if not S_ISDIR(target_directory.st_mode):
                error = errno.ENOENT if self.is_windows_fs else errno.ENOTDIR
                error_fct(error, file_path)
        target_directory.add_entry(file_object)