Commit bd63b6a1 authored by Daniel Espinosa Ortiz's avatar Daniel Espinosa Ortiz

providers: improve error reporting

parent d0ad749a
......@@ -4082,6 +4082,7 @@ check_parameters (GdaMetaContext *context, GError **error, gint nb, ...)
_("Missing or wrong arguments for table '%s': %s"),
context->table_name, str);
g_free (str);
retval = -1;
}
/*g_print ("Check arguments context => found %d\n", retval);*/
......@@ -4293,6 +4294,9 @@ local_meta_update (GdaServerProvider *provider, GdaConnection *cnc, GdaMetaConte
i = check_parameters (context, error, 1,
&name, G_TYPE_STRING, NULL,
"specific_name", &name, NULL);
if (error && *error) {
return FALSE;
}
ASSERT_TABLE_NAME (tname, "element_types");
if (i < 0) {
retval = _gda_server_provider_meta_0arg (provider, cnc, store, context,
......
......@@ -2891,25 +2891,19 @@ static gboolean
meta_finalize_result (gpointer retval, GError **call_error, GError **loc_error)
{
if (retval) {
if (loc_error)
g_clear_error (loc_error);
g_clear_error (loc_error);
return TRUE;
}
else {
if (loc_error && *loc_error && (*loc_error)->message)
g_set_error (call_error, GDA_SERVER_PROVIDER_ERROR, GDA_SERVER_PROVIDER_INTERNAL_ERROR,
_("Internal error please report bug to "
"https://gitlab.gnome.org/GNOME/libgda/issues "
"Reported error is: %s"),
(*loc_error)->message);
else
g_set_error (call_error, GDA_SERVER_PROVIDER_ERROR, GDA_SERVER_PROVIDER_INTERNAL_ERROR,
_("Internal error please report bug to "
"https://gitlab.gnome.org/GNOME/libgda/issues"));
if (loc_error)
g_clear_error (loc_error);
return FALSE;
if (loc_error && *loc_error && (*loc_error)->message) {
g_set_error (call_error, GDA_SERVER_PROVIDER_ERROR, GDA_SERVER_PROVIDER_INTERNAL_ERROR,
_("Internal error please report bug to https://gitlab.gnome.org/GNOME/libgda/issues Reported error is: %s"),
(*loc_error)->message);
} else {
g_set_error (call_error, GDA_SERVER_PROVIDER_ERROR, GDA_SERVER_PROVIDER_INTERNAL_ERROR,
_("Internal error please report bug to https://gitlab.gnome.org/GNOME/libgda/issues"));
}
g_clear_error (loc_error);
return FALSE;
}
gboolean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment