Add a feature so the application automatically breaks on the line where the error occurred together with the current values of any variable, temp-table and etc in scope. This will make it easier to know where the break point should be placed.