Introduce QueryFailure exceptions
Add HandlerFailure exceptions
Handle sendmsg failures