The internal error handler of the robot takes over when there is no error handler created by the user, which would indicate that your error handler is incorrectly defined. Take a look at page 74 of the Technical Reference Manual - Rapid Overview
@xerim the error handler is correctly defined and works for division by 0.
Try this:
MODULE MainModule
FUNC bool CanRobReach(robtarget ToPoint,
PERS tooldata Tool,
\PERS Wobjdata wobj)
VAR jointtarget jdump;
jdump:=CalcJointT(ToPoint,tool\wobj?wobj);
RETURN TRUE;
ERROR
SkipWarn;
RETURN FALSE;
ENDFUNC
PROC main()
CONST robtarget far_away:=[[10000,10000,10000],[0.0208901,-0.980874,-0.19283,-0.016298],[0,0,1,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST jointtarget far_away2:=[[1000,1000,1000,1000,1000,1000], [9E9,9E9,9E9,9E9,9E9,9E9]];
IF CanRobReach(far_away, tool0) THEN
MoveabsJ far_away2, v100,fine, tool0;
ELSE
TpWrite "error caught";
ENDIF
ENDPROC
ENDMODULE
OK, I made a bit of an oversight. I took what you said that the error number was, just as it reads and will be written into the error log as such. BUT, and this is a big but here, Rapid system error numbers are mostly 4 digits some are 3. The 50065 Kinematic error will go into the motion. So what will work is code like this:
PROC Routine1()
MyJointTarget:=CalcJointT(myRobtarget,Tool0);
Stop;
ERROR
TEST ERRNO
CASE ERR_ROBLIMIT:
TRYNEXT;
CASE ERR_OUTSIDE_REACH:
TRYNEXT;
DEFAULT:
Stop;
ENDTEST
ENDPROC
This is a very simple example, tested in RS, goes into error handler. Of course the robtarget is declared way out of reach.
@mkatliar Were you able to get this to work?
@xerim @lemster68
Below is the reply that I got from an ABB engineer:
Unfortunately it is not working like you try to do, MoveAbsJ instruction does not throw any errors when trying to travel to out of reach point.
MoveAbsJ can only handle

Usually robots work in their working envelope and never cross the range border. Only collision errors are handled.
You can go around and use function CalcJointT(). CalcJoinT() can throw errors like mentioned below or write Your own error handler.
Please check if GetTrapData instruction is sufficient for you. This instruction should be located in second task to avoid stopping program execution in case of any error in Motion task.
Then you can use SocketCreate or SocketConnect to establish TCP/IP connection between robot controller and PC to exchange data.
So the bottomline is: there is no way to catch a kinematic error and continue the execution of the motion task.
