[Feature-14838] Capture perspective scripting errors from project

A lot of times when scripting in Perspective, I have some kind of error or typo that prevents the script from running (usually on a button click). I have to log into the gateway status screen to see if there are any errors.

Anyway you guys can add a session event that will run and return this error?

2 Likes

Hi Jae,

Better feedback on script erring is a good idea. I’m going to create a ticket and see if we can come up with something, whether it be an action, or something else.

-Perry

2 Likes

Playing around a bit, (since the system.gui.* functions aren’t available) I created a parameterized view that takes in the exception message as a param and displays it to the user on an exception. The code you’d use in the button would look like:

try:
#	Button Functionality Here
	beforeDefined()
except Exception as e:
	system.perspective.openPopup('ExceptionPopup','Error Popup',params = {'Exception':e.message})

My view just has a label and disabled textarea. I bound the textarea value to the exception param. It ends up looking like this.

image

2 Likes