I need to customise the error message that is displayed to a user if there is a prefill error.
Instead of the default message "Sorry An Error Has Occurred", "Groovy Form Prefill Service Error", I would like a custom message like "Data missing from url. Please contact XYZ", or "Data missing from request parameters. Please contact ABC", or other custom messages.
I have added the code to throw new Exception, and that message appears in the TM error logs.
I would like a custom message to also appear to the user.
Hey Mark, the error page you are seeing is a generic error page that is part of the Space your form is being rendered in. You can find the content for this page by opening your Space in TM (under Forms -> Form Spaces menu) and going to the Pages tab.
You can edit this page to display different or additional information based on the data available on the Error Log object. For example, $errorLog.message will display the message you are passing into the Exception.
Be aware that the changes you make will effect any other error type that triggers this page also.
thanks for the details. I expected that it was a template page, but I couldn't find it in my earlier searching.