function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
b-Forceb-Force 

System.LimitException: Apex CPU time limit exceeded

Guys,

 

I am getting following exception

 

System.LimitException: Apex CPU time limit exceeded

Class.MailManager.IsTestPassed: line 142, column 1 Class.MailManager.SearchEmailTemplates: line 56, column 4 External entry point

 

 

I tried to handle same with try catch,

 

But there is no luck

 

Does anybody came across such exception ???

 

Any help on this will be great

 

Cheers,

Bala

*werewolf**werewolf*

Well that's kind of a chicken and egg problem.  I wouldn't think that you could possibly catch that exception because once you've hit it, you've expired all your available CPU time -- it won't give you another millisecond!

 

So what is it you're doing that's hogging all the CPU?  That's what I'd be looking at.  Perhaps there's something you can make more efficient.

b-Forceb-Force

Thanks for reply,

 

I had queried all email templates, while iterating through them,

Time limit get finished. :(

 

Now I am looking for processing Email template with small chunks 

 

Thanks,

Bala