less confusing error when apps get past main
This commit is contained in:
parent
6ece3bb664
commit
1017e80fe5
10
src/task.lua
10
src/task.lua
|
@ -388,15 +388,17 @@ _M.NOP = NOP
|
||||||
function spawn_main()
|
function spawn_main()
|
||||||
task.spawn(call_main)
|
task.spawn(call_main)
|
||||||
task.scheduler()
|
task.scheduler()
|
||||||
assert(false, "Teliva's scheduler ran out of work; this shouldn't happen.\n"..
|
assert(false, "Teliva ran out of stuff to do. Possible causes:\n"..
|
||||||
"Either a channel is blocked forever or you're reading past\n"..
|
"- main() returned. Apps shouldn't let this happen.\n"..
|
||||||
"the end of a file (after recv() returned nil).\n")
|
"- App is reading past the end of a file (after recv() returned nil)\n"..
|
||||||
|
"- Some channel is blocked forever.\n"..
|
||||||
curses.nodelay(true)
|
curses.nodelay(true)
|
||||||
curses.getch()
|
curses.getch()
|
||||||
end
|
end
|
||||||
|
|
||||||
-- This function exists only to make the call to 'main' visible to Teliva.
|
-- This function exists only to make the call to 'main' visible to Teliva.
|
||||||
-- Teliva can't yet recognize the caller of indirect calls.
|
-- Teliva can't yet recognize the caller of indirect calls, as happens with
|
||||||
|
-- task.spawn.
|
||||||
function call_main()
|
function call_main()
|
||||||
main()
|
main()
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue