Is there any way lua script to capture the exception error in freeswitch.Dbh? - Stack Overflow

admin2025-04-22  6

2025-01-21 20:45:59.832751 90.95% [ERR] switch_odbc.c:529 ERR: [update tbl_channel set msisdn = 100 where chan_name = 'CH001'] [STATE: 23000 CODE 2601 ERROR: [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot insert duplicate key row in object 'dbo.tbl_channel' with unique index 'idx_msisdn'. The duplicate key value is (100). ]

I'm getting above error when trying to execute the update query in lua script but it throw exception error for unique column. Is there any way for lua script to capture the exception error?

local dbh = freeswitch.Dbh(DSN);
dbh:query("update tbl_channel set msisdn = 100 where chan_name = 'CH001'");
dbh:release();
转载请注明原文地址:http://anycun.com/QandA/1745304558a90628.html