Built-in exceptions not being recognized by Illuminated Cloud, hence no autocomplete is available .

Issue #2019 invalid
Nagendra Singh created an issue

There are some exception specific built in methods.

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_exception_builtin.htm

try {
    insert mList;
} catch (DmlException de) {
    Integer numErrors = de.getNumDml();
    System.debug('getNumDml=' + numErrors);
    for(Integer i=0;i<numErrors;i++) {
        System.debug('getDmlFieldNames=' + de.getDmlFieldNames(i));
        System.debug('getDmlMessage=' + de.getDmlMessage(i));  
    }
}

But these getNumDml etc does not gets recognized by Illuminated cloud.

and shows as error on editor.

Comments (5)

  1. Scott Wells repo owner

    Hi. Can you show me what System.DmlException looks like in your generated OST? Here's mine which includes those methods as reported by the Salesforce Tooling API:

    // Generated by Illuminated Cloud on Mon Nov 29 16:09:36 CST 2021. Do not edit.
    
    global class /*System.*/DmlException extends Exception 
    {
        global DmlException()
        {
        }
    
        global DmlException(Exception param1)
        {
        }
    
        global DmlException(String param1)
        {
        }
    
        global DmlException(String param1, Exception param2)
        {
        }
    
        global Exception getCause()
        {
        }
    
        global List<String> getDmlFieldNames(Integer index)
        {
        }
    
        global List<SObjectField> getDmlFields(Integer index)
        {
        }
    
        global String getDmlId(Integer index)
        {
        }
    
        global Integer getDmlIndex(Integer index)
        {
        }
    
        global String getDmlMessage(Integer index)
        {
        }
    
        global String getDmlStatusCode(Integer index)
        {
        }
    
        global StatusCode getDmlType(Integer index)
        {
        }
    
        global Integer getLineNumber()
        {
        }
    
        global String getMessage()
        {
        }
    
        global Integer getNumDml()
        {
        }
    
        global String getStackTraceString()
        {
        }
    
        global String getTypeName()
        {
        }
    
        global void initCause(Exception cause)
        {
        }
    
        global void setMessage(String message)
        {
        }
    }
    
  2. Nagendra Singh reporter

    Ok yes, I see that in now in DMLException. I think I was searching in Exception class. Sorry for confusion .

  3. Log in to comment