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
Sowndarya KesariSowndarya Kesari 

Custom exception for Reusing Old Password

Hi All,
I have developed an API which let user to change his/her password. I used system.setPassword() method for this.

Now, when a user uses his previous passwords it will throw an exception "System.InvalidParameterValueException: UNKNOWN_EXCEPTION: invalid repeated password". I want to handle it and show different error message.

Could you help me how I can handle this?