]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
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 04eed5503d18cb6d3b6e4d0cb127f98637d36b5d..c4de2e8f37d5a94937f0fe3519715d40242f5329 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)
-               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;
 }
diff --git a/aft.c b/aft.c
index b4adbacf6e2a93b17c25f11bacb9845c47538c53..f41bfadea25385c4ab1c9a169a15b0c755440c98 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("failed to open audio file table\n");
        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;
+       }
+       PARA_NOTICE_LOG("failed to open audio file table\n");
        return ret;
 }