Hm, what about returning "undefined" or false something like that and just close the connection in this case?
Apart from that, I don't think it's a good idea to change the general array object for this special purpose...