PxPlus User Forum

Main Board => Discussions => Language => Topic started by: Thomas Bock on August 30, 2018, 05:12:57 AM

Title: distinguish errors 0
Post by: Thomas Bock on August 30, 2018, 05:12:57 AM
Accidently *optsel was called from a cron job, which caused an error 0 in line 260. Due to the nature of an error 0 our errorhandler tried to continue, which will never succeed.
The question is, if that error 0 can be dinstinguished somehow from an error 0 caused by lock/open/extract?
Title: Re: distinguish errors 0
Post by: Mike King on August 30, 2018, 08:47:01 AM
The reporting of error 0, like many other error conditions, is based on the OS error code returned to PxPlus.  The most common OS error that will generate an error 0 is "Permissions Denied" which is all the OS tells is about the operation we performed.

In your case, you could test the value in RET or the contents of MSG(ret) to see if it can provide more details.

Another option is to use the value in STK(-1) within your error handler to obtain the line number where the error occured and then LST(PGM(stno, -1)) to get the actual line of code.