log token error correctly