--- owl-2.2.2.orig/zephyr.c
+++ owl-2.2.2/zephyr.c
@@ -70,9 +70,11 @@
 int owl_zephyr_loadsubs_helper(ZSubscription_t subs[], int count)
 {
   int i, ret = 0;
+  errcode_t code;
   /* sub without defaults */
-  if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) {
-    owl_function_error("Error subscribing to zephyr notifications.");
+  code = ZSubscribeToSansDefaults(subs,count,0);
+  if (code != ZERR_NONE) {
+    owl_function_error("Error %s subscribing to zephyr notifications.", error_message(code));
     ret=-2;
   }
 
@@ -171,9 +173,11 @@
 {
 #ifdef HAVE_LIBZEPHYR
   ZSubscription_t subs[10];
-    
-  if (ZSubscribeTo(subs,0,0) != ZERR_NONE) {
-    owl_function_error("Error subscribing to default zephyr notifications.");
+  errcode_t code;
+
+  code = ZSubscribeTo(subs,0,0);
+  if (code != ZERR_NONE) {
+    owl_function_error("Error %s subscribing to default zephyr notifications.", error_message(code));
     return(-1);
   }
   return(0);
@@ -190,6 +194,7 @@
   char subsfile[MAXPATHLEN], buffer[1024];
   int count, ret, i;
   struct stat statbuff;
+  errcode_t code;
 
   if (filename==NULL) {
     sprintf(subsfile, "%s/%s", owl_global_get_homedir(&g), ".anyone");
@@ -230,8 +235,9 @@
   }
 
   /* sub with defaults */
-  if (ZSubscribeToSansDefaults(subs,count,0) != ZERR_NONE) {
-    owl_function_error("Error subscribing to zephyr notifications.");
+  code = ZSubscribeToSansDefaults(subs,count,0);
+  if (code != ZERR_NONE) {
+    owl_function_error("Error %s subscribing to zephyr notifications.", error_message(code));
     ret=-2;
   }
 
@@ -284,14 +290,16 @@
 {
 #ifdef HAVE_LIBZEPHYR
   ZSubscription_t subs[5];
+  errcode_t code;
 
   subs[0].zsub_class=class;
   subs[0].zsub_classinst=inst;
   subs[0].zsub_recipient=recip;
 
   ZResetAuthentication();
-  if (ZUnsubscribeTo(subs,1,0) != ZERR_NONE) {
-    owl_function_error("Error unsubbing from <%s,%s,%s>", class, inst, recip);
+  code = ZUnsubscribeTo(subs,1,0);
+  if (code != ZERR_NONE) {
+    owl_function_error("Error %s unsubbing from <%s,%s,%s>", error_message(code), class, inst, recip);
     return(-2);
   }
   return(0);
@@ -464,7 +472,7 @@
   owl_free(notice.z_message);
   ZFreeNotice(&notice);
   if (ret!=ZERR_NONE) {
-    owl_function_error("Error sending zephyr");
+    owl_function_error("Error %s sending zephyr", error_message(ret));
     return(ret);
   }
   return(0);
@@ -640,7 +648,7 @@
   ZResetAuthentication();
   ret=ZLocateUser(user,&numlocs,auth?ZAUTH:ZNOAUTH);
   if (ret != ZERR_NONE) {
-    return(owl_sprintf("Error locating user %s\n", user));
+    return(owl_sprintf("Error %s locating user %s\n", error_message(ret), user));
   }
 
   if (numlocs==0) {
@@ -652,6 +660,7 @@
 
   out=strdup("");
   for (;numlocs;numlocs--) {
+    /* should check return here, and fix loop */
     ZGetLocations(&locations,&one);
     myuser=short_zuser(user);
     tmp=owl_sprintf("%s%s: %s\t%s\t%s\n",
@@ -769,6 +778,8 @@
   ret=ZSetLocation(eset);
   owl_zephyr_process_events(NULL);
   if (ret != ZERR_NONE) {
+    /* we should check this, but ZSetLocation almost *always* gives Internal Error. Sigh. */
+    /* is this the "SENT" bug? if so, it is fixed... */
     /* owl_function_makemsg("Error setting location: %s", error_message(ret)); */
   }
 #endif
@@ -853,6 +864,7 @@
   if (ret==ZERR_TOOMANYSUBS) {
     return(owl_strdup("Zephyr: too many subscriptions\n"));
   } else if (ret || (num <= 0)) {
+    /* need to attach error_message(ret) here! */
     return(owl_strdup("Zephyr: error retriving subscriptions\n"));
   }
 
@@ -863,6 +875,7 @@
     if ((ret = ZGetSubscriptions(&sub, &one)) != ZERR_NONE) {
       owl_free(out);
       ZFlushSubscriptions();
+      /* need to attach error_message(ret) here! */
       out=owl_strdup("Error while getting subscriptions\n");
       return(out);
     } else {
