return error code on connection refusal