help regarding search potential from crm to creator

help regarding search potential from crm to creator

Hello

I need some help.

I have created a custom link in potentials. On click it redirect me to Zoho creator. I am passing potential id with that.
In zoho creator, I am fetching this value and save in to table. This is used for changing the stage value in crm.
In Zoho creator, I have a button "Email for signature". On Click of this a email is send to the user with a link.
When User open the link, it will show two button "Accept " and "Decline".
On click of Accept, it search for the record in crm based on potential id and make it closed won.
And In case of Decline, It is doing the same thing. Instead of closed won it update to closed lost.
When I deleted the potential from crm, it is showing the message "Error occured. Please contact application owner". But I want to display my custom message instead of this.
Below is the code which I am using:

 resp = zoho.crm.getRecordById("Potentials", potentialid.toLong());
   if(!resp.isEmpty())
    {
        stage = resp.get("Stage");
        response = zoho.crm.updateRecord("Potentials", potentialid.toString(), { "Stage" : "Closed Lost" });
        alert("Status change to Closed Lost ");
       
    }
    else
    {
        alert("Corresponding Potential record in CRM is missing ");
    }