{"action":"created","issue":{"url":"https://api.github.com/repos/wahern/cqueues/issues/83","labels_url":"https://api.github.com/repos/wahern/cqueues/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/wahern/cqueues/issues/83/comments","events_url":"https://api.github.com/repos/wahern/cqueues/issues/83/events","html_url":"https://github.com/wahern/cqueues/pull/83","id":96473181,"number":83,"title":"Non-string error objects result in a 'corrupt' error","user":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wahern/cqueues/labels/component:%20core","name":"component: core","color":"f7c6c7"},{"url":"https://api.github.com/repos/wahern/cqueues/labels/enhancement","name":"enhancement","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-07-22T04:34:59Z","updated_at":"2015-08-23T10:32:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/wahern/cqueues/pulls/83","html_url":"https://github.com/wahern/cqueues/pull/83","diff_url":"https://github.com/wahern/cqueues/pull/83.diff","patch_url":"https://github.com/wahern/cqueues/pull/83.patch"},"body":"Non-string error objects result in an internal 'corrupt' error\r\nExample:\r\n```lua\r\nlocal cq = require \"cqueues\".new()\r\ncq:wrap(function()\r\n\terror({message = \"my error object\"})\r\nend)\r\nprint(cq:step())\r\n```\r\n```\r\nlua: /usr/share/lua/5.3/cqueues.lua:83: corrupt error stack: expected string, got table at index 4\r\nstack traceback:\r\n\t[C]: in upvalue 'step'\r\n\t/usr/share/lua/5.3/cqueues.lua:83: in method 'step'\r\n\tregress/non-string-errors.lua:5: in main chunk\r\n\t[C]: in ?\r\n```\r\nFixing it is as simple as removing this check:\r\n```diff\r\ndiff --git a/src/cqueues.c b/src/cqueues.c\r\nindex 18625f2..956fe3e 100644\r\n--- a/src/cqueues.c\r\n+++ b/src/cqueues.c\r\n@@ -1325,7 +1325,6 @@ static void err_checktype(lua_State *L, int index, int type) {\r\n \r\n static const char *err_pushstring(lua_State *L, struct callinfo *I) {\r\n        if (I->error.string) {\r\n-               err_checktype(L, I->error.string, LUA_TSTRING);\r\n                lua_pushvalue(L, I->error.string);\r\n        } else {\r\n                lua_pushstring(L, \"no error message\");\r\n```\r\nBut perhaps a renaming of fields/functions should be done at the same time."},"comment":{"url":"https://api.github.com/repos/wahern/cqueues/issues/comments/133814162","html_url":"https://github.com/wahern/cqueues/pull/83#issuecomment-133814162","issue_url":"https://api.github.com/repos/wahern/cqueues/issues/83","id":133814162,"user":{"login":"daurnimator","id":127971,"avatar_url":"https://avatars.githubusercontent.com/u/127971?v=3","gravatar_id":"","url":"https://api.github.com/users/daurnimator","html_url":"https://github.com/daurnimator","followers_url":"https://api.github.com/users/daurnimator/followers","following_url":"https://api.github.com/users/daurnimator/following{/other_user}","gists_url":"https://api.github.com/users/daurnimator/gists{/gist_id}","starred_url":"https://api.github.com/users/daurnimator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/daurnimator/subscriptions","organizations_url":"https://api.github.com/users/daurnimator/orgs","repos_url":"https://api.github.com/users/daurnimator/repos","events_url":"https://api.github.com/users/daurnimator/events{/privacy}","received_events_url":"https://api.github.com/users/daurnimator/received_events","type":"User","site_admin":false},"created_at":"2015-08-23T10:32:41Z","updated_at":"2015-08-23T10:32:41Z","body":"bump?"}}