To avoid messages going to the ERRORLOG, use WHENEVER ANY ERROR CONTINUE
https://4js.com/online_documentation/fjs-fgl-manual-html/User/Exceptions.html#TRACE, unfortunately that doesn't help you as TRY is effectively a WHENEVER ANY ERROR GOTO
https://4js.com/online_documentation/fjs-fgl-manual-html/User/Exceptions.html#TRYCATCHI'm guessing you are using TRY so that ...
TRY
LET x = 1/0
CATCH
CASE STATUS
WHEN -1202 DISPLAY "Divide by zero error"
OTHERWISE CALL ERRORLOG("Some other error")
END CASE
END TRY
... is the equivalent of ...
WHENEVER ANY ERROR CONTINUE
LET x = 1/0
CASE STATUS
WHEN -1202 DISPLAY "Divide by zero error"
OTHERWISE CALL ERRORLOG("Some other error")
END CASE
WHENEVER ANY ERROR STOP
... and as you've discovered, the TRY will write messages to the ERRORLOG whilst WHENEVER ANY ERROR CONTINUE doesn't.
Personally I'd like to see CATCH be able to trap certain exceptions ...
WHENEVER ANY ERROR CALL error_handler
TRY
LET x = 1/0
CATCH -1202
DISPLAY "Divide by zero error"
END TRY
... so that I can handle the error I have anticipated, and let the normal error handler deal with unexpected errors. Certainly in that case I wouldn't want the error I have anticipated and dealt with to appear in the errorlog, but I would want the unanticipated error to be in the errorlog.
For now, you could get clever with the pre-processor and do something like ...
&define TRY_NOLOG CALL STARTLOG("/dev/null") TRY
&define END_TRY_NOLOG END TRY CALL STARTLOG("error.log")
TRY_NOLOG
LET x = 1/0
CATCH
CASE STATUS
WHEN -1202 DISPLAY "Divide by zero error"
END CASE
END_TRY_NOLOG
Reuben