afs: Improve error diagnostics.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 14 Mar 2020 09:33:40 +0000 (10:33 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 11 Jul 2020 17:26:31 +0000 (19:26 +0200)
If an afs table can not be opened, we miss to log the error reason.
Also, if the audio file table does not exist, state this fact
explicitly.

afs.c
aft.c

diff --git a/afs.c b/afs.c
index 04eed55..c4de2e8 100644 (file)
--- a/afs.c
+++ b/afs.c
@@ -1043,7 +1043,8 @@ static int com_init_callback(struct afs_callback_arg *aca)
        }
        ret = open_afs_tables();
        if (ret < 0)
        }
        ret = open_afs_tables();
        if (ret < 0)
-               para_printf(&aca->pbout, "cannot open afs tables\n");
+               para_printf(&aca->pbout, "cannot open afs tables: %s\n",
+                       para_strerror(-ret));
 out:
        return ret;
 }
 out:
        return ret;
 }
diff --git a/aft.c b/aft.c
index b4adbac..f41bfad 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -2534,10 +2534,12 @@ static int aft_open(const char *dir)
                PARA_NOTICE_LOG("current audio file hash lookup: success\n");
                return 1;
        }
                PARA_NOTICE_LOG("current audio file hash lookup: success\n");
                return 1;
        }
-       PARA_NOTICE_LOG("failed to open audio file table\n");
        audio_file_table = NULL;
        audio_file_table = NULL;
-       if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT))
+       if (ret == -OSL_ERRNO_TO_PARA_ERROR(E_OSL_NOENT)) {
+               PARA_WARNING_LOG("no audio file table\n");
                return 1;
                return 1;
+       }
+       PARA_NOTICE_LOG("failed to open audio file table\n");
        return ret;
 }
 
        return ret;
 }