[Freeswitch-users] Lua freeswitch.Dbh() question

Abaci B abaci64 at gmail.com
Tue Nov 15 19:54:02 MSK 2016


Basically what I want is the text of the error returned from the database,
something like how it's handled in LuaSQL
http://keplerproject.github.io/luasql/manual.html#errors pcall is for lua
errors in this case there is no lua error.

On Tue, Nov 15, 2016 at 2:10 AM, Artur Mega <findmeinwland at gmail.com> wrote:

> Do you need to get text of an error? And to catch it in lua code? Why not
> just to check returned value? I dont remember, but returned value can be
> nul or item with type `userdata`. If you still want text of an error, i
> think you can try to catch it with pcall https://www.lua.org/pil/8.4.html
>
> 2016-11-14 23:11 GMT+05:00 Abaci B <abaci64 at gmail.com>:
>
>> when runned a query using freeswitch.Dbh dbh:query, if there is results
>> it a function for each returned row where you can see the data. however, if
>> there is an error you can see the database returned error in the console on
>> level ERR but you don't get it back in lua
>> is someone aware of a way to get the rror back into lua?
>>
>> _________________________________________________________________________
>> Professional FreeSWITCH Consulting Services:
>> consulting at freeswitch.org
>> http://www.freeswitchsolutions.com
>>
>> Official FreeSWITCH Sites
>> http://www.freeswitch.org
>> http://confluence.freeswitch.org
>> http://www.cluecon.com
>>
>> FreeSWITCH-users mailing list
>> FreeSWITCH-users at lists.freeswitch.org
>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>> http://www.freeswitch.org
>>
>
>
>
> --
> Артур
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20161115/4c57af97/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list