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
akshay21akshay21 

how to handle unexpected errors in soql

hello,

 

i'm getting the following error:-

 

An unexpected error occurred. Please include this ErrorId if you contact support: 398158509-89290 (-1629302653)

 

now where use this error id..? i tried contacting support but i only get to CRM support... Is there any other place where i can get support..?

 

 

thanks in advance..!!

regards,

akshay

Best Answer chosen by Admin (Salesforce Developers) 
Ramon PereiraRamon Pereira

Hello akshay21,

 

Try using a try catch block in your code, or post your code so we can analyze it.

 

try{
     //Your code here
} catch (ListException e) {
     //Optional catch of a specific exception type
     //Specific exception handling code here
} catch (Exception e) {
     //Generic exception handling code here
} finally {
     //optional finally block
     //code to run whether there is an exception or not
}

 

 

 

This article contains some instructions on how to use the command try catch in the sales force.

 

thanks

All Answers

IspitaIspita
Hi Akshay,
One generally gets this error when the cause of the error is not clearly defined , problem with these errors is that each time a new error id is generated. Hence the solution would be trap and catch all the known errors your code might encounter and catch the scenario mentioned by you in a generic catch block.
Hope this answers your question....
Thanks
Ramon PereiraRamon Pereira

Hello akshay21,

 

Try using a try catch block in your code, or post your code so we can analyze it.

 

try{
     //Your code here
} catch (ListException e) {
     //Optional catch of a specific exception type
     //Specific exception handling code here
} catch (Exception e) {
     //Generic exception handling code here
} finally {
     //optional finally block
     //code to run whether there is an exception or not
}

 

 

 

This article contains some instructions on how to use the command try catch in the sales force.

 

thanks

This was selected as the best answer