Handle ConnectionRefusedError error in HTTP API