pgExecuteRemote() failed

Workarounds and usability notes.

pgExecuteRemote() failed

Postby John Robin Dove » Wed Oct 16, 2019 10:55 am

Hi Clifton,

Is it possible to intercept this message? I know exactly why pgExecuteRemote has failed and its failure is significant in my system. I would like to be able to handle this error myself rather than let the message appear.

John
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: pgExecuteRemote() failed

Postby Clifton » Wed Oct 16, 2019 12:05 pm

Not sure if this would work, but if you are running pgExecuteRemote() in an XML file, then wrap it in a try block and intercept the catch statement. The code would look like this:
    try {
    tbfunction_pgExecuteRemote( [your params] );
    } catch(e) {
    alert(e); //this line is not needed, but would pass the error handler
    }

I'm not sure this will work because pgExecuteRemote() already has some built in error handling. But it is worth a try.
What is the error you are getting?
The key is to query the conditions first to eliminate the error from appearing.
 
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: pgExecuteRemote() failed

Postby John Robin Dove » Wed Oct 16, 2019 12:37 pm

Thanks very much for your prompt reply. I was just about to remove my question because I have found a solution. It's very similar to yours but the code is in an external html that I load with pgGotoURL. It is an encryption system. I could not use yours because it's from the original pc version of my project so it has to function on a local computer not a server and I hope to keep both versions (pc and dhtml). My code is now:
Code: Select all
function decryptMyText(txt, myKey)
{
try {
     var decoded = GibberishAES.dec(txt, myKey);
    return decoded;
   } catch (err) {
   alert("Invalid key"); // or return something else
   }
};
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 4 guests

cron