Capturing connection errors!

Ashley Tyler

New Member
Good day all,

Is it possible to trap errors resulting from connection errors such as;

appserver <name> not found at host 1.2.3.4::......... etc

This is causing problems with users getting terribly irate when for example an appserver has been stopped for any reason.

Any help will be greatly appreciated.

Thanks in advance.

Ashley Tyler

:dead:
 

MSilva

New Member
Hi,

I'm not sure if I've understood your question...but anyway...

If you're not using ADM2 you can ry to use NO-ERROR clause after RUNS and CONNECT...

Example:

CREATE SERVER hAppSrv.
ret = hAppSrv:CONNECT(stringconec,
c-user, /* user */
c-senha, /*passwd */
"BLA BLA BLA") NO-ERROR . /* parms string */

IF ERROR-STATUS:ERROR THEN DO:

MESSAGE "ConApSrv: OOOPS... Sorry, Don't be irate, Connection lost" VIEW-AS ALERT-BOX.

RETURN ERROR RETURN-VALUE.
END.



IF VALID-HANDLE(hAppSrv) THEN DO:

RUN {&prog} ON hAppSrv TRANSACTION DISTINCT
{&pam}
NO-ERROR .

IF ERROR-STATUS:ERROR THEN DO:
MESSAGE "OOPS Again.... Sorry, get easy'!"
SKIP RETURN-VALUE
VIEW-AS ALERT-BOX ERROR.

END.
END.
 
Top