added GetErrorCode method, so that we have it available on iOS as well