Normalizing errors so that we can check their status code more easily