Function to search through messages and find messages that contain an error. This function first reads the input to see if it should search all indexes or a pre-filtered set of indexes. Then, it will search through the indexes. For each index that is an error (priority == MSG_USER_ALERT), it will add that message's index to a temporary array of indexes. After the for loop is complete, the recen