Change HttpError data check to typesafe