<html><head></head><body>Hi,<br><br>I don't think we should have one ENOx error code for each and every type of object. Error codes are a trade-off. For detailed diagnostic, we won't escape from logs.<br><br><div class="gmail_quote">Le 20 mai 2019 15:11:23 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-20 13:58, 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;">Hi,<br><br>Entry not found is pretty much what all those error code mean, actually. <br>The loss of type-specificity is old (and you seem to have contributed to <br></blockquote><br>I plead guilty. But having more detailed errors is probably what would <br>should use. And yes, we should use them more and properly and forward <br>then than just ending up with VLC_EGENERIC everywhere.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">it...). But well, here, if we don't remove Lua RC, then we should simply <br>have it print command specific errors rather than vague generic messages <br>like this or the previous code does.<br><br>Le 20 mai 2019 09:44:42 GMT+03:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<br><br>    On 2019-05-19 19:20, Rémi Denis-Courmont wrote:<br><br>        vlc | branch: master | Rémi Denis-Courmont <remi@remlab.net> |<br>        Sun May 19 20:13:33 2019 +0300|<br>        [161832532aa60c2f06798f79c1898680f39a2c1d] | committer: Rémi<br>        Denis-Courmont<br><br>        lua: use vlc_strerror_c()<br><br>            <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><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><br><br>    This is not equivalent to ENOENT.<br><br>        + case VLC_ENOOBJ: err = ENOENT; break;<br><br><br>    This is not equivalent to ENOENT.<br><br>        + case VLC_ENOVAR: err = ENOENT; break;<br><br><br>    This is not equivalent to ENOENT.<br><br>        + 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><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><br><br><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser <br>ma brièveté.<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><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>