Changeset 3372

Show
Ignore:
Timestamp:
06/16/08 20:58:07 (4 months ago)
Author:
dgollub
Message:

Improve error handling if format plugin/objformat couldn't be found.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/osyncplugin.c

    r3371 r3372  
    317317                osync_plugin_info_set_config(plugin_info, config); 
    318318 
    319 #if 0 /* Not ready for prime-time (dgollub, 20080613) */ 
    320319                /** Redudant(aka. stolen) code from opensync/client/opensync_client.c */ 
    321320                /* Enable active sinks */ 
     
    330329                                const char *objformat_str = osync_objformat_sink_get_objformat(format_sink); 
    331330                                OSyncObjFormat *objformat = osync_format_env_find_objformat(format_env, objformat_str); 
    332                                 const char *objtype = osync_objformat_get_objtype(objformat);;  
     331 
     332                                if (!objformat) { 
     333                                        osync_error_set(error, OSYNC_ERROR_MISCONFIGURATION, "Couldn't find object format \"%s\"!", objformat_str);  
     334                                        goto error_free_pluginconfig; 
     335                                } 
     336 
     337                                const char *objtype = osync_objformat_get_objtype(objformat); 
    333338 
    334339                                /* Check for ObjType sink */ 
     
    346351 
    347352                osync_plugin_config_unref(config); 
    348 #endif /* Not ready. */          
    349353 
    350354        }