I was wondering if there was a way to get the exact line where the error has occurred when using a custom error handler function. Would have made it a lot easier to track the bugs. Currently, I am able to fetch the date, time, form, and user where the error has occurred.
This is my code
def errorhandler(err):
Notification('We have been notified about the issue and will try to fix it as fast as possible. Meanwhile, you can try refreshing the page to see if the error persists',title='Oops! An unexpected error occured!',style='danger',timeout=15).show()
try:
anvil.server.call('errreport',str(err),str(get_open_form()))
except:
Notification('Cannot connect to server. Please check your network and try again. If the problem persists, please refresh the page.').show()
set_default_error_handling(errorhandler)