Re: [gnome-db] Connection errors



On Mon, 2004-09-27 at 14:47 +1200, Dru wrote:
> Rodrigo Moya wrote:
> 
> >On Sun, 2004-09-26 at 16:01 +1200, Dru wrote:
> >  
> >
> >>Rodrigo Moya wrote:
> >>
> >>    
> >>
> >>>On Mon, 2004-09-13 at 23:12 +1200, Dru wrote:
> >>> 
> >>>
> >>>      
> >>>
> >>>>If a connection fails to create with gda_client_open_connection and 
> >>>>returns null, how can you get an error string describing the problem 
> >>>>with the connection?  From my understanding you need a valid connection 
> >>>>to retrieve errors.
> >>>>
> >>>>   
> >>>>
> >>>>        
> >>>>
> >>>in that case, you need to attach to the "notify_event" signal on the
> >>>GdaClient. Once you get the GdaConnection, you can use
> >>>gda_connection_get_errors to get the errors.
> >>> 
> >>>
> >>>      
> >>>
> >>So if connection is unsuccessful you still get a returned GdaConnection* 
> >>so you can then retrieve errors of that.
> >>
> >>    
> >>
> >no, if there's an error, you get a NULL GdaConnection. So to get the
> >errors while trying to connect, you need to connect to the
> >"notify_event" signal on the GdaClient.
> >  
> >
> gda_client_notify_event requires a GdaConnection* so its confusing me. 
> Do you know of an application that uses this so i can download the 
> source and see how its done?

struct _GdaClientClass {
        GObjectClass parent_class;
                                                                                
        /* signals */
        void (* event_notification) (GdaClient *client,
                                     GdaConnection *cnc,
                                     GdaClientEvent event,
                                     GdaParameterList *params);
};

I mean the event_notification signal on the GdaClient class. Just
connect to it, and you'll get your callback called for the error. You
can see the code that does that in gda_connection_new, which calls
gda_client_notify_error_event to notify the listeners of the errors
occurred while trying to open the connection.
-- 
Rodrigo Moya <rodrigo gnome-db org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]