Handle errors on token return