Thanks for the response.
What I ended up doing to stop the errors for the immediate moment was
to fix the underlying bad query which was causing the error that was
getting stuck in the ping response header, and then I also modified
the ping() method to only look for 'HTTP/1.1 200' to verify if it's a
valid response header, and not look at any characters beyond that.
So that has resolved the problem for now, but the underlying issue of
why that error was getting stuck in the ping response header still
isn't resolved, so I'm going to take your advice and see about
upgrading to a newer version of the client, and also look into setting
up a logging solution as you suggested.
Thanks again for the insight,
Peter