[gq-commit] gq/src browse-dnd.c,1.16,1.17 browse.c,1.84,1.85 configfile.c,1.44,1.45 dn-browse.c,1.1,
Status: Beta
Brought to you by:
sur5r
Update of /cvsroot/gqclient/gq/src In directory sc8-pr-cvs1:/tmp/cvs-serv29329 Modified Files: browse-dnd.c browse.c configfile.c dn-browse.c input.c ldapops.c ldif.c ref-browse.c schema.c state.c Log Message: * Improved error messages, this closes a 1.0 TODO item: Now most error messages in most areas indicate what went wrong my mentioning a server, entry or other object that caused the error Index: browse-dnd.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/browse-dnd.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** browse-dnd.c 17 Oct 2003 07:26:25 -0000 1.16 --- browse-dnd.c 17 Oct 2003 10:20:34 -0000 1.17 *************** *** 893,897 **** server->server_down = 1; error_push(ctx, ! _("Server down. Export may be incomplete!")); push_ldap_addl_error(ld, ctx); --- 893,898 ---- server->server_down = 1; error_push(ctx, ! _("Server '%s' down. Export may be incomplete!"), ! server->name); push_ldap_addl_error(ld, ctx); *************** *** 900,904 **** if (rc != LDAP_SUCCESS) { error_push(ctx, ! _("LDAP error. Export may be incomplete!")); push_ldap_addl_error(ld, ctx); --- 901,906 ---- if (rc != LDAP_SUCCESS) { error_push(ctx, ! _("LDAP error while searching below '%s'. Export may be incomplete!"), ! dn); push_ldap_addl_error(ld, ctx); Index: browse.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/browse.c,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** browse.c 17 Oct 2003 07:26:25 -0000 1.84 --- browse.c 17 Oct 2003 10:20:36 -0000 1.85 *************** *** 147,151 **** /* problem with DN */ /* printf("problem dn: %s\n", dn); */ ! error_push(ctx, _("Cannot explode DN. Maybe problems with quoting or special characters. See RFC 2253 for details of DN syntax.")); goto fail; --- 147,151 ---- /* problem with DN */ /* printf("problem dn: %s\n", dn); */ ! error_push(ctx, _("Cannot explode DN '%s'. Maybe problems with quoting or special characters. See RFC 2253 for details of DN syntax."), dn); goto fail; Index: configfile.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/configfile.c,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** configfile.c 17 Oct 2003 06:52:39 -0000 1.44 --- configfile.c 17 Oct 2003 10:20:37 -0000 1.45 *************** *** 232,236 **** home = homedir(); if(home == NULL) { ! error_push(context, _("you have no home directory!")); return(NULL); } --- 232,236 ---- home = homedir(); if(home == NULL) { ! error_push(context, _("You have no home directory!")); return(NULL); } Index: dn-browse.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/dn-browse.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** dn-browse.c 17 Oct 2003 07:26:25 -0000 1.1 --- dn-browse.c 17 Oct 2003 10:20:37 -0000 1.2 *************** *** 231,236 **** if( (outfile = fopen(filename, "w")) == NULL) { ! error_push(ctx, _("Could not open output file: %s"), ! strerror(errno)); goto fail; --- 231,236 ---- if( (outfile = fopen(filename, "w")) == NULL) { ! error_push(ctx, _("Could not open output file '%1$s': %2$s"), ! filename, strerror(errno)); goto fail; *************** *** 247,252 **** if(written != out->len) { error_push(ctx, ! _("Save failed: Only %1$d of %2$d bytes written"), ! written, out->len); goto fail; /* sometimes goto is useful */ } --- 247,252 ---- if(written != out->len) { error_push(ctx, ! _("Save to '%3$s' failed: Only %1$d of %2$d bytes written"), ! written, out->len, filename); goto fail; /* sometimes goto is useful */ } *************** *** 291,295 **** error_push(ctx, ! _("Server down. Export may be incomplete!")); push_ldap_addl_error(ld, ctx); goto fail; --- 291,296 ---- error_push(ctx, ! _("Server '%s' down. Export may be incomplete!"), ! server->name); push_ldap_addl_error(ld, ctx); goto fail; *************** *** 297,301 **** /* report error */ error_push(ctx, ! _("LDAP error. Export may be incomplete!")); push_ldap_addl_error(ld, ctx); /* statusbar_msg(ldap_err2string(ldap_result2error(ld, */ --- 298,303 ---- /* report error */ error_push(ctx, ! _("LDAP error while searching below '%s'. Export may be incomplete!"), ! (char *) I->data); push_ldap_addl_error(ld, ctx); /* statusbar_msg(ldap_err2string(ldap_result2error(ld, */ *************** *** 555,559 **** if(msg == -1) { ! statusbar_msg("%s", ldap_err2string(msg)); close_connection(server, FALSE); gtk_clist_thaw(GTK_CLIST(ctree)); --- 557,563 ---- if(msg == -1) { ! statusbar_msg("Error while searching below '%1$s': %2$s", ! entry->dn, ! ldap_err2string(msg)); close_connection(server, FALSE); gtk_clist_thaw(GTK_CLIST(ctree)); *************** *** 607,610 **** --- 611,615 ---- if (rc != LDAP_SUCCESS) { + /* FIXME: better error message (but what is the exact cause?)*/ error_push(context, ldap_err2string(rc)); push_ldap_addl_error(ld, context); Index: input.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/input.c,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** input.c 17 Oct 2003 06:28:59 -0000 1.71 --- input.c 17 Oct 2003 10:20:38 -0000 1.72 *************** *** 1,5 **** /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2001 Bert Vermeulen This program is released under the Gnu General Public License with --- 1,6 ---- /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2003 Bert Vermeulen ! Copyright (C) 2002-2003 Peter Stamfest This program is released under the Gnu General Public License with *************** *** 1215,1222 **** char *parentdn, **rdn; add_context = error_new_context(_("Error adding entry")); /* handle impossible errors first - BTW: no need for I18N here*/ - formlist = iform->formlist; if(!formlist) { error_push(add_context, --- 1216,1225 ---- char *parentdn, **rdn; + formlist = iform->formlist; + assert(formlist); + add_context = error_new_context(_("Error adding entry")); /* handle impossible errors first - BTW: no need for I18N here*/ if(!formlist) { error_push(add_context, *************** *** 1227,1230 **** --- 1230,1234 ---- server = iform->server; + assert(server); if(!server) { *************** *** 1279,1283 **** } if(res != LDAP_SUCCESS) { ! error_push(add_context, ldap_err2string(res)); push_ldap_addl_error(ld, add_context); error_flush(add_context); --- 1283,1289 ---- } if(res != LDAP_SUCCESS) { ! error_push(add_context, _("Error adding new entry '%1$s': '%2$s'"), ! dn, ! ldap_err2string(res)); push_ldap_addl_error(ld, add_context); error_flush(add_context); *************** *** 1421,1425 **** iform->oldlist = oldlist; } else { ! error_push(mod_context, ldap_err2string(res)); push_ldap_addl_error(ld, mod_context); } --- 1427,1433 ---- iform->oldlist = oldlist; } else { ! error_push(mod_context, _("Error modifying entry '%1$s': %2$s"), ! dn, ! ldap_err2string(res)); push_ldap_addl_error(ld, mod_context); } *************** *** 1484,1488 **** /* parsing error */ ! error_push(context, _("Cannot explode DN. Maybe problems with quoting or special characters. See RFC 2253 for details of DN syntax.")); error = 1; --- 1492,1497 ---- /* parsing error */ ! error_push(context, _("Cannot explode DN '%s'. Maybe problems with quoting or special characters. See RFC 2253 for details of DN syntax."), ! dn); error = 1; *************** *** 1547,1557 **** server->server_down++; } ! #if defined(HAVE_LDAP_RENAME) ! error_push(context, "ldap_rename_s: %s", ! ldap_err2string(rc)); ! #else ! error_push(context, "ldap_modrdn2_s: %s", ldap_err2string(rc)); - #endif push_ldap_addl_error(ld, context); error = 2; --- 1556,1562 ---- server->server_down++; } ! error_push(context, _("Error renaming entry '%1$s': %2$s"), ! olddn, ldap_err2string(rc)); push_ldap_addl_error(ld, context); error = 2; Index: ldapops.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/ldapops.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** ldapops.c 5 Oct 2003 13:43:51 -0000 1.16 --- ldapops.c 17 Oct 2003 10:20:38 -0000 1.17 *************** *** 82,86 **** e = ldap_first_entry(sld, res); if (e == NULL) { ! error_push(err_ctx, ldap_err2string(ldap_result2error(sld, res, 0))); push_ldap_addl_error(sld, err_ctx); /* ldap_perror(sld, "ldap_first_entry"); */ --- 82,89 ---- e = ldap_first_entry(sld, res); if (e == NULL) { ! error_push(err_ctx, ! _("Error during base search for '%1$s': %2$s"), ! source_dn, ! ldap_err2string(ldap_result2error(sld, res, 0))); push_ldap_addl_error(sld, err_ctx); /* ldap_perror(sld, "ldap_first_entry"); */ *************** *** 97,101 **** source_server->server_down++; } ! error_push(err_ctx, ldap_err2string(ldap_result2error(sld, res, 0))); push_ldap_addl_error(sld, err_ctx); /* ldap_perror(sld, "search"); */ --- 100,107 ---- source_server->server_down++; } ! error_push(err_ctx, ! _("Error during base search for '%1$s': %2$s"), ! source_dn, ! ldap_err2string(ldap_result2error(sld, res, 0))); push_ldap_addl_error(sld, err_ctx); /* ldap_perror(sld, "search"); */ *************** *** 159,163 **** } else if (rc == LDAP_SERVER_DOWN) { source_server->server_down++; ! error_push(error_context, ldap_err2string(rc)); goto done; } else { --- 165,172 ---- } else if (rc == LDAP_SERVER_DOWN) { source_server->server_down++; ! error_push(error_context, ! _("Error renaming entry '%1$s': %2$s"), ! source_dn, ! ldap_err2string(rc)); goto done; } else { *************** *** 212,216 **** ldap_mods_free(mods, 1); ! if (rc == LDAP_SUCCESS) { /* printf("ldap_add %s -> %s rc=%d\n", */ /* source_dn, newdn, rc); */ --- 221,233 ---- ldap_mods_free(mods, 1); ! if (rc != LDAP_SUCCESS) { ! error_push(error_context, ! _("Error adding new entry '%1$s': %2$s"), ! newdn, ! ldap_err2string(rc)); ! push_ldap_addl_error(tld, error_context); ! /* ldap_perror(sld, "ldap_add"); */ ! goto done; ! } else { /* printf("ldap_add %s -> %s rc=%d\n", */ /* source_dn, newdn, rc); */ *************** *** 267,271 **** } else { error_push(error_context, ! "%s: %s", source_dn, ldap_err2string(rc)); push_ldap_addl_error(sld, error_context); } --- 284,289 ---- } else { error_push(error_context, ! _("Error searching below '%1$s': %2$s"), ! source_dn, ldap_err2string(rc)); push_ldap_addl_error(sld, error_context); } *************** *** 296,310 **** } error_push(error_context, ! "%s: %s", source_dn, ldap_err2string(rc)); push_ldap_addl_error(sld, error_context); goto done; } } - - } else { - error_push(error_context, ldap_err2string(rc)); - push_ldap_addl_error(tld, error_context); - /* ldap_perror(sld, "ldap_add"); */ - goto done; } --- 314,323 ---- } error_push(error_context, ! _("Error deleting '%1$s': %2$s"), ! source_dn, ldap_err2string(rc)); push_ldap_addl_error(sld, error_context); goto done; } } } Index: ldif.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/ldif.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ldif.c 17 Oct 2003 06:40:27 -0000 1.15 --- ldif.c 17 Oct 2003 10:20:38 -0000 1.16 *************** *** 84,88 **** /* an error occurred */ ! error_push(error_context, _("Cannot retrieve DN of entry.\n")); push_ldap_addl_error(ld, error_context); return FALSE; --- 84,88 ---- /* an error occurred */ ! error_push(error_context, _("Cannot retrieve DN of entry.")); push_ldap_addl_error(ld, error_context); return FALSE; Index: ref-browse.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/ref-browse.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ref-browse.c 17 Oct 2003 07:26:25 -0000 1.1 --- ref-browse.c 17 Oct 2003 10:20:38 -0000 1.2 *************** *** 295,299 **** int ctx = error_new_context(_("Adding server permanently")); ! error_push(ctx, _("Another server with this name already exists.")); /* popup error */ error_flush(ctx); --- 295,301 ---- int ctx = error_new_context(_("Adding server permanently")); ! error_push(ctx, ! _("Another server with the name '%s' already exists."), ! server->name); /* popup error */ error_flush(ctx); Index: schema.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/schema.c,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** schema.c 17 Oct 2003 05:46:07 -0000 1.22 --- schema.c 17 Oct 2003 10:20:38 -0000 1.23 *************** *** 1,5 **** /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2001 Bert Vermeulen This program is released under the Gnu General Public License with --- 1,6 ---- /* GQ -- a GTK-based LDAP client ! Copyright (C) 1998-2003 Bert Vermeulen ! Copyright (C) 2002-2003 Peter Stamfest This program is released under the Gnu General Public License with *************** *** 69,73 **** server = server_by_name(config->schemaserver); if(server == NULL) { ! error_push(ec, _("Cannot find last-resort schema server")); ss = NULL; goto done; --- 70,75 ---- server = server_by_name(config->schemaserver); if(server == NULL) { ! error_push(ec, _("Cannot find last-resort schema server '%s'"), ! config->schemaserver); ss = NULL; goto done; *************** *** 81,85 **** ss = get_server_schema(server); if (ss == NULL) { ! error_push(ec, _("Cannot obtain schema from last-resort schema server")); } done: --- 83,89 ---- ss = get_server_schema(server); if (ss == NULL) { ! error_push(ec, ! _("Cannot obtain schema from last-resort schema server '%s'"), ! server->name); } done: Index: state.c =================================================================== RCS file: /cvsroot/gqclient/gq/src/state.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** state.c 14 Oct 2003 22:28:39 -0000 1.7 --- state.c 17 Oct 2003 10:20:38 -0000 1.8 *************** *** 474,478 **** home = homedir(); if(home == NULL) { ! error_push(context, _("you have no home directory!")); return(NULL); } --- 474,478 ---- home = homedir(); if(home == NULL) { ! error_push(context, _("You have no home directory!")); return(NULL); } *************** *** 578,582 **** if (fd < 0) { error_push(save_context, ! _("Unable to open %1$s for writing:\n%2$s\n"), tmpstatefile, strerror(errno)); --- 578,582 ---- if (fd < 0) { error_push(save_context, ! _("Unable to open '%1$s' for writing: %2$s"), tmpstatefile, strerror(errno)); |