summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2021-02-24 22:00:29 +0100
committerAki <please@ignore.pl>2021-02-24 22:00:29 +0100
commitd6bd328ff84f24d81e1406457777767bbc32bf8b (patch)
treea38628b371b49b002dd404a1019f36c3eee4f9c5
parent87d97759fbe62be67ad26f55600715c0f426f542 (diff)
downloadplop-d6bd328ff84f24d81e1406457777767bbc32bf8b.zip
plop-d6bd328ff84f24d81e1406457777767bbc32bf8b.tar.gz
plop-d6bd328ff84f24d81e1406457777767bbc32bf8b.tar.bz2
Add error echo in client handler
-rw-r--r--plop.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/plop.c b/plop.c
index 41b9138..445e3f8 100644
--- a/plop.c
+++ b/plop.c
@@ -183,6 +183,15 @@ int plop_handle_client(lua_State * L, struct epoll_event * event)
}
default:
{
+ const char * err = lua_tostring(c->L, -1);
+
+ if (NULL == err)
+ {
+ err = "Unknown error ocurred";
+ }
+
+ dprintf(2, "%s\n", err);
+ lua_pop(c->L, 1);
connection_free(L, c);
return -1;
}