Skip to content

Commit 46a5e79

Browse files
committed
catch aligned with one in setRecord(Id)
1 parent 926c699 commit 46a5e79

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nebula-logger/core/main/logger-engine/classes/LogEntryEventBuilder.cls

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,8 +462,12 @@ global with sharing class LogEntryEventBuilder {
462462
} else {
463463
try {
464464
this.logEntryEvent.RecordId__c = record.Id;
465-
} catch (System.SObjectException ex) {
466-
// Certain SObjectTypes (such as Platform Events) do not have the ID field; that's OK, just skip setting it
465+
} catch (System.SObjectException sobjectException) {
466+
// Some SObject Types (such as Platform Events) do not have the ID field;
467+
// that's OK, just skip setting it.
468+
if (sobjectException.getMessage().contains('Invalid field Id') == false) {
469+
throw sobjectException;
470+
}
467471
}
468472
this.logEntryEvent.RecordSObjectClassification__c = getSObjectClassification(record.getSObjectType());
469473
this.logEntryEvent.RecordSObjectType__c = record.getSObjectType().toString();

0 commit comments

Comments
 (0)