Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle failures in noticeReceiver/noticeProcessor #14

Open
daurnimator opened this issue Jan 21, 2015 · 0 comments
Open

Handle failures in noticeReceiver/noticeProcessor #14

daurnimator opened this issue Jan 21, 2015 · 0 comments

Comments

@daurnimator
Copy link
Contributor

The current noticeReceiver and noticeProcessor use lua functions that may fail and longjmp out.

One option is to lua_pcall out to a second function.

  • This could make it easier to add coroutine support (via lua_pcallk)

Alternatively, only use functions that can't fail.

  • use a unique pointer and lua_rawgetp instead of lua_pushstring+lua_rawget
    • This is new in lua 5.2+
  • preallocate the PGresult *
  • never call luaL_error
    • A PQnoticeReceiver is by definition called for warnings or below, so it's not supposed to fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant