ensure_valid_cursor/2
     ensure_valid_cursor(+Cursor, +Goal)
     

Cursor must be a valid cursor. If it's not, an error message mentioning Goal is printed, and execution is aborted.