check http response code to avoid bad init and crash
log error