raise an exception on 401 return code