Skip to content
Newer
Older
100644 23 lines (12 sloc) 968 Bytes
49624ce @creationix Mark what needs to be done for async errors
creationix authored Oct 17, 2011
1
2 # Classes of errors
3
4 - Sync argument errors. These should "throw" and many do because that's how `luaL_check*` works.
5 - Errors while async. These happened while trying to do an async action. They should either be handed to the callback or emitted as error.
6 - Error while executing async callbacks. If an error handler has a bug, there isn't much we can do. Either "throw" or send as "error" event if possible.
7
8 # Error handling
9
10 - async errors are always handed to lua somewhere with the exception of "error" events that aren't listened for
11 - uncaught "error" events and sync errors will crash the process and should always show a stack trace
12
13 # Current places where async errors happen
14
15 I know errno and path, this is a fs error
16
17 luv_io_error(L, req->errorno, NULL, NULL, req->path);
18
19 I only know it was the last error (`after shutdown`, `after_write`, `on_connection`)
20
21 luv_io_error(L, uv_last_error(uv_default_loop()).code, NULL, NULL, NULL);
22
Something went wrong with that request. Please try again.