$eb.executeFunction('fn'); versus Form onError Event

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

Steve James
Ebase User
Posts: 331
Joined: Mon Mar 10, 2014 8:34 am

$eb.executeFunction('fn'); versus Form onError Event

#1

Postby Steve James » Thu Mar 03, 2016 1:55 pm

We had a situation earlier today where we accidentally rolled a change to a form but missed a client script.

The form runs $eb.executeFunction('fn'); but the function wasn't available for the form.

If the form doesn't have a form onError then the function call returns (or can be displayed in the failureCallBack)

Browser developer tools
{"error":{"message":"Server Error: fn is not accessible."},"success":false}

Also the logs show
16-Mar-03 13:43:59:305 | ERROR | Server Error: fn is not accessible.
com.ebasetech.ufs.kernel.FormException: fn is not accessible.


This form had an onError event which fired but the result in the browser was
{"success":true}

the logs showed

16-Mar-03 13:46:15:222 | INFO | Transaction rolled back
16-Mar-03 13:46:15:222 | INFO | Transaction rolled back

I appreciate it is an odd set of circumstances but it was mildly tricky to trace through.

1 - how can I pick up the error in a server side script?
2 - shouldn't the browser result be still show the fail message?

Thanks
Steve
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Thu Mar 03, 2016 4:25 pm

I think this is probably a bug. Failures in a client API call shouldn't invoke the on error event, they should be fed back to the client.
0 x


Who is online

Users browsing this forum: No registered users and 10 guests