Changeset 7320610 for storage_xml.c


Ignore:
Timestamp:
2015-03-10T07:33:54Z (6 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
afbad28
Parents:
8b91a1f
git-author:
dequis <dx@…> (07-03-15 04:10:59)
git-committer:
dequis <dx@…> (10-03-15 07:33:54)
Message:

Various user experience/error reporting improvements

  • Show version as part of the initial message of &bitlbee
  • Use g_strerror() to show actual errors when saving xml configs
  • Only show "The nick is (probably) not registered" for ENOENT, use g_strerror() for the rest of OS errors when loading xml configs
  • Show "Protocol not found: <name>" when find_protocol() returns null, useful when the user uninstalls a plugin accidentally.
  • Suggest the user to check the system clock when getting error 401 from the twitter stream (other REST endpoints show a better error message)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • storage_xml.c

    r8b91a1f r7320610  
    103103        if (protocol) {
    104104                prpl = find_protocol(protocol);
     105                if (!prpl) {
     106                        irc_rootmsg(xd->irc, "Error loading user config: Protocol not found: `%s'", protocol);
     107                        return XT_ABORT;
     108                }
    105109                local = protocol_account_islocal(protocol);
    106110        }
     
    197201        fn = g_strconcat(global.conf->configdir, xd->given_nick, ".xml", NULL);
    198202        if ((fd = open(fn, O_RDONLY)) < 0) {
    199                 ret = STORAGE_NO_SUCH_USER;
     203                if (errno == ENOENT) {
     204                        ret = STORAGE_NO_SUCH_USER;
     205                } else {
     206                        irc_rootmsg(irc, "Error loading user config: %s", g_strerror(errno));
     207                }
    200208                goto error;
    201209        }
     
    377385        strcat(path, ".XXXXXX");
    378386        if ((fd = mkstemp(path)) < 0) {
    379                 irc_rootmsg(irc, "Error while opening configuration file.");
    380                 return STORAGE_OTHER_ERROR;
     387                goto error;
    381388        }
    382389
     
    400407
    401408error:
    402         irc_rootmsg(irc, "Write error. Disk full?");
     409        irc_rootmsg(irc, "Write error: %s", g_strerror(errno));
    403410        ret = STORAGE_OTHER_ERROR;
    404411
Note: See TracChangeset for help on using the changeset viewer.