aboutsummaryrefslogtreecommitdiffstats
path: root/storage_xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage_xml.c')
-rw-r--r--storage_xml.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/storage_xml.c b/storage_xml.c
index 0dd4ec53..38a73d87 100644
--- a/storage_xml.c
+++ b/storage_xml.c
@@ -102,6 +102,10 @@ static xt_status handle_account(struct xt_node *node, gpointer data)
protocol = xt_find_attr(node, "protocol");
if (protocol) {
prpl = find_protocol(protocol);
+ if (!prpl) {
+ irc_rootmsg(xd->irc, "Error loading user config: Protocol not found: `%s'", protocol);
+ return XT_ABORT;
+ }
local = protocol_account_islocal(protocol);
}
@@ -196,7 +200,11 @@ static storage_status_t xml_load_real(irc_t *irc, const char *my_nick, const cha
fn = g_strconcat(global.conf->configdir, xd->given_nick, ".xml", NULL);
if ((fd = open(fn, O_RDONLY)) < 0) {
- ret = STORAGE_NO_SUCH_USER;
+ if (errno == ENOENT) {
+ ret = STORAGE_NO_SUCH_USER;
+ } else {
+ irc_rootmsg(irc, "Error loading user config: %s", g_strerror(errno));
+ }
goto error;
}
@@ -376,8 +384,7 @@ static storage_status_t xml_save(irc_t *irc, int overwrite)
strcat(path, ".XXXXXX");
if ((fd = mkstemp(path)) < 0) {
- irc_rootmsg(irc, "Error while opening configuration file.");
- return STORAGE_OTHER_ERROR;
+ goto error;
}
tree = xml_generate(irc);
@@ -399,7 +406,7 @@ static storage_status_t xml_save(irc_t *irc, int overwrite)
goto finish;
error:
- irc_rootmsg(irc, "Write error. Disk full?");
+ irc_rootmsg(irc, "Write error: %s", g_strerror(errno));
ret = STORAGE_OTHER_ERROR;
finish: