+ Start a Discussion
Joshua Long 17Joshua Long 17 

Internal Salesforce.com Error Creating FeedAttachment

I have code that creates FeedItem and FeedAttachment It works fine in Sandbox but in Production I am getting:
21:43:57.239 (2631676416)|FATAL_ERROR|Internal Salesforce.com Error

I do not see any other information regarding the error it hits.
The code snippet I have is:
List<Database.SaveResult> srInsertList = new List<Database.SaveResult> ();
        try {
            if (!allFeedAttachment.isEmpty()) {
                List<FeedAttachment> allFeedAttachmentList = new List<FeedAttachment> ();
                allFeedAttachmentList.addall(allFeedAttachment);
                system.debug('size of post attachments ' + allFeedAttachment.size());
                srInsertList.addall(Database.insert(allFeedAttachmentList, false));
            }
            for (Database.SaveResult res : srInsertList) {
                if (!res.isSuccess()) {
                    Database.Error error = res.getErrors().get(0);
                    String failedDML = error.getMessage();
                    String errMsg = failedDML + ' Fields: ' + error.getFields();
                    system.debug('error>>> ' + errMsg);
                    system.debug('error>>>2 ' + res.getErrors());
                }
            }
        }
        catch(Exception ex) {
            System.debug('feedAttachment insert error: ' + ex);
        }

Any help figuring this out would be greatly appreciated!
Raj VakatiRaj Vakati
Some time salesforce errors are not friendly ..can you add some debug logs and see why its failing ..?