mirror of https://github.com/sipwise/klish.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
648 B
29 lines
648 B
#include "private.h"
|
|
|
|
void
|
|
l_print_error(lua_State *L, const char *func, const char *when, int res)
|
|
{
|
|
switch (res) {
|
|
case LUA_ERRRUN:
|
|
printf("%s (%s):\n%s\n", func, when,
|
|
lua_tostring(L, -1));
|
|
break;
|
|
case LUA_ERRSYNTAX:
|
|
printf("%s (%s):\n%s\n", func, when,
|
|
lua_tostring(L, -1));
|
|
break;
|
|
case LUA_ERRMEM:
|
|
printf("%s (%s):\nmem alloc error\n", func, when);
|
|
break;
|
|
case LUA_ERRERR:
|
|
printf("%s (%s):\nerror handler error\n", func, when);
|
|
break;
|
|
case LUA_ERRFILE:
|
|
printf("%s (%s):\ncouldn't open file\n", func, when);
|
|
break;
|
|
default:
|
|
printf("%s (%s):\nunknown error\n", func, when);
|
|
break;
|
|
}
|
|
}
|