Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Status
colourBlue
titlelycia


Problem

If I use the TRY...CATCH statement I can get the error code using the SQLCA or STATUS variables but these do not return more detail such as function where the error occurred, lines where it occurred. How can I get this information?

Solution

Pass the STRING parameter which will contain a range of lines where an error may occur to the fn_handle_exception() function, and handle it inside.

Info

Error lines in native Lycia error messages are available only in debug(unl) cache.
Fast release cache doesn’t contain such info by default. To turn it on, add QX_REL_LINE_INFO=1 to inet.env


There are two options to retrieve a full error message:

Code Block
MAIN
DEFINE err INTEGER
CALL startlog("xxxx.log")
TRY
 OPEN WINDOW w1 WITH FORM "yyyy"
CATCH
 CALL fgl_getkey()
END TRY
END MAIN

or

Code Block
MAIN
 DEFINE err INTEGER
 CALL startlog("xxxx.log")
 WHENEVER ANY ERROR CALL errorlog
 OPEN WINDOW w1 WITH FORM "yyyy"
 CALL fgl_getkey()
END MAIN

To get the error text, use ERR_GET( )
Find more details on how to implement error logging in Lycia Online Tutorials

Filter by label (Content by label)
showLabelsfalse
max10
spacescom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@13968
showSpacefalse
sortmodified
reversetrue
typepage
cqllabel = "development_lycia" and type = "page" and space = "QKB" and ancestor = "66289698"
labelserror_details try_catch exception