How to display errors when using LiveCode Server

When developing on the server it is vital that you get as much error information as possible. revServer has a really handy little switch that allows you to tell revServer to output error messages right there in the browser.

Set the errorMode to 'inline'

Set the errorMode to 'inline'

1) SETUP YOUR ERROR MESSAGES

The screenshot shows the source of a web page I am working on. Place the following line of script at the top of your irev script. It must be on the first line and surrounded by standard "<?rev" and "?>" tags.

set the errorMode to "inline"

All error messages will now be output directly to the browser.

2) START CODING

As you can see I have entered an invalid line of code. When I go to my web page an error message should be displayed.

The result

The result

The errors have been output direct to my web page in the browser.

2 Comments

YOKOTA Fumitaka

Now I know how to display the errors.

But I also want to treat the error message in the script of iRev file.

Please tell me how this can be done.

Best Regards,

Michael McCreary

H

To handle errors within your script files, you can use try catch blocks. For example:

try
...
your code
...
catch tError
...
error handling
...
end try

Warm Regards

Michael

Add your comment

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.