How to trace an error to a line in my custom code

This is related to another topic that I created: Create new line and release from UBAQ custom code