handle error when non-200 is returned