+ Start a Discussion
IanDoneganIanDonegan 

Are these errors benign?

Hello, All.

I am writing an Apex test and encountering a couple of errors.

This portion of the class:
System.debug('Get Client Record Type ID');
        String ClientRecordTypeID = Schema.Sobjecttype.Contact.getRecordTypeInfosByName().get('Client').getRecordTypeId();

        System.debug('Insert Account');
        Account ac = new Account(Name='test');
        insert ac;

        System.debug('Insert contacts');
        List<Contact> clients = new List<Contact>();
        for (integer i = 0; i < 3; i++) {
            Contact c = new Contact();
            c.firstName = 'test';
            c.lastName = 'test' + i;
            c.Birthdate = System.today();
            c.AccountId = ac.Id;
            c.Email = 'fake@fake.com';
            c.RecordTypeId = ClientRecordTypeID;
            clients.add(c);
        }

        System.debug('---');
        List<Database.SaveResult> results = Database.insert(clients, false);
        System.debug('---');

        for (Database.SaveResult r: results) {
            System.debug(r);
        }
Produces this portion of the debug log:
12:44:17.6 (7729678)|USER_DEBUG|[7]|DEBUG|Get Client Record Type ID
12:44:17.6 (617672538)|USER_DEBUG|[10]|DEBUG|Insert Account
12:44:18.42 (1042384178)|USER_DEBUG|[14]|DEBUG|Insert contacts
12:44:18.42 (1045430887)|USER_DEBUG|[28]|DEBUG|---
12:44:18.42 (1278714555)|USER_DEBUG|[35]|ERROR|()
12:44:18.42 (1278873811)|USER_DEBUG|[44]|ERROR|()
12:44:18.42 (1301826736)|USER_DEBUG|[30]|DEBUG|---
12:44:18.42 (1302330854)|USER_DEBUG|[33]|DEBUG|Database.SaveResult[getErrors=();getId=0030H00005CBCFhQAP;isSuccess=true;]
12:44:18.42 (1302454551)|USER_DEBUG|[33]|DEBUG|Database.SaveResult[getErrors=();getId=0030H00005CBCFiQAP;isSuccess=true;]
12:44:18.42 (1302565041)|USER_DEBUG|[33]|DEBUG|Database.SaveResult[getErrors=();getId=0030H00005CBCFjQAP;isSuccess=true;]
My concerns lie with the two ERROR messages between the "---" debug messages, seeming to come from the insert operation.

The errors do not seem to be causing any problems, and the insert operation is reporting success, but I cannot identify where the errors are coming from. Does anyone here have any ideas?