This same thing plagues live development (given that the static server code is where this came from).

I actually think we shouldn't try to fix this here. This kind of gets into the "node extensibility" story, but I think this code needs to be pulled up to a higher level utility that manages the connection, warns the user if something's wrong and has a "safe mode".