<html><head></head><body>Hi,<br><br>Entry not found is pretty much what all those error code mean, actually. The loss of type-specificity is old (and you seem to have contributed to it...). But well, here, if we don't remove Lua RC, then we should simply have it print command specific errors rather than vague generic messages like this or the previous code does.<br><br><div class="gmail_quote">Le 20 mai 2019 09:44:42 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2019-05-19 19:20, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">vlc | branch: master | Rémi Denis-Courmont <remi@remlab.net> | Sun May 19 20:13:33 2019 +0300| [161832532aa60c2f06798f79c1898680f39a2c1d] | committer: Rémi Denis-Courmont<br><br>lua: use vlc_strerror_c()<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><a href="http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=161832532aa60c2f06798f79c1898680f39a2c1d">http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=161832532aa60c2f06798f79c1898680f39a2c1d</a><br></blockquote><hr>  modules/lua/libs/misc.c | 23 ++++++++++++++++++++++-<br>  1 file changed, 22 insertions(+), 1 deletion(-)<br><br>diff --git a/modules/lua/libs/misc.c b/modules/lua/libs/misc.c<br>index b251eb7f22..25f44c3047 100644<br>--- a/modules/lua/libs/misc.c<br>+++ b/modules/lua/libs/misc.c<br>@@ -33,6 +33,7 @@<br>  # include "config.h"<br>  #endif<br>  <br>+#include <errno.h><br>  #include <math.h><br>  #include <stdlib.h><br>  <br>@@ -84,7 +85,27 @@ vlc_object_t * vlclua_get_this( lua_State *L )<br>  int vlclua_push_ret( lua_State *L, int i_error )<br>  {<br>      lua_pushnumber( L, i_error );<br>-    lua_pushstring( L, vlc_error_string( i_error ) );<br>+<br>+    int err;<br>+<br>+    switch( i_error )<br>+    {<br>+        case VLC_SUCCESS:   err = 0;         break;<br>+        case VLC_ENOMEM:    err = ENOMEM;    break;<br>+        case VLC_ETIMEOUT:  err = ETIMEDOUT; break;<br>+        case VLC_EBADVAR:   err = EINVAL;    break;<br>+        case VLC_ENOMOD:    err = ENOENT;    break;<br></blockquote><br>This is not equivalent to ENOENT.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">+        case VLC_ENOOBJ:    err = ENOENT;    break;<br></blockquote><br>This is not equivalent to ENOENT.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">+        case VLC_ENOVAR:    err = ENOENT;    break;<br></blockquote><br>This is not equivalent to ENOENT.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">+        case VLC_EGENERIC:<br>+            lua_pushstring( L, "generic error" );<br>+            return 2;<br>+        default:<br>+            lua_pushstring( L, "unknown error" );<br>+            return 2;<br>+    }<br>+<br>+    lua_pushstring( L, vlc_strerror_c(err) );<br>      return 2;<br>  }<hr>vlc-commits mailing list<br>vlc-commits@videolan.org<br><a href="https://mailman.videolan.org/listinfo/vlc-commits">https://mailman.videolan.org/listinfo/vlc-commits</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>