adding better error message when using an incomplete cursor on a closed connection