hacky way of throwing an http error