Added the testing code for getToken to throw an error while meet undefined identifier.
Program the function to throw and update the errorMessage while meet undefined identifier.