catch a gateway shutdown exception from httplib, closes #252"