Updated getError to allow retrieval of specified error by code