I want to create a custom exception. In this exception, I want to make a constructor which take one string arguments and append in getMessage
.How to accomplish this.
public class TimelineException extends Exception{
private String message;
public override String getMessage(){
return 'Not able to post to Timeline.getting response from Api : '+ message;
}
}
The main problem I am facing is when I use this:
public TimelineException(Sting x){
}
then its give me an error:
Save error: System exception constructor already defined: (String) GMirror.cls /Google Salesforce Integration/src/classes.