Throw exceptions on 4xx and 5xx errors