Intercept http status code to check server encounter error