Some how nothing is being caught. Not sure, but it could be not understanding how exception really works. So I have a method that does everything including querying, than finally does an update to an opportunity record
public void createAlert(){
try{
for (List<OpportunityLineItem> oliList : [Select oli.id from OpportunityLineItem oli Where oli.OpportunityId = :oppId]){
//some logic
}
//some logic
update updateOpp;
} catch (System.StringException e) {
system.debug('Exception===>' + e.getMessage());
}
}
I am invoking this method from the develop console right now like this :
Alert opp = new Alert('aaaaaaaaa');
opp.createAlert();
I get this error:
11:36:07:147 FATAL_ERROR System.StringException: Invalid id: aaaaaaaaa
But it never caught the exception, so I never got the "Exception===>" debug message.