Search the site

ScriptServer offers a descriptive error page with a possibility to display the code that produced the error. You can use this information to derive the error source and correct it. This tutorial will give you a course of action to follow when you run into error pages.

Finding the bug

Most often you get an error message in front of you when something goes wrong. Typically it looks like this:

  

If you cannot see the buttons, then you do not have permission to edit the code of the error producing page or its template.

If you have a different kind of error page, then you will need to change the setup of your error pages. This is done in registry and described elsewhere.

The screen will tell you that the error occurred in the page Dev\test\kirne\sampleError at line 7. If you know which template this page is using, open it in Template Workshop. If you don’t know, or if your page is not using a template at all, then open the page in System Editor.

Scroll down to the line number and that should be where your bug is.

The line number is wrong!

If you can’t find the bug in that page and on that line number, you are most likely using a Scriptlet method on your page, and the line number refers to the line in the Scriptlet. To make sure that the error producing code piece is not your template, click the button “Show original script code”.

You will now get a pop up window with the code displayed. If this code is not the code in your template, do the following:

  1. Open the System Editor if you haven’t done so already.
  2. Expand to /websys/scriptlets and click that page to make it selected
  3. In the Tools menu, click Search
  4. Copy the name of a method declared in the script code you got from the error page pop up window and paste it into the “Search for”-field.
  5. Check Include Sub-pages and uncheck Include Textfields, then click Search.
  6. When the search is complete, you should have at least 1 result. Click that result to open it in the System Editor.
  7. If this is the same code as displayed in the pop up window, then you have found the Scriptlet producing the error.
  8. Important! Open the Scriptlet in the Scriptlet Manager instead of the System Editor, otherwise you will not be able to recompile the Scriptlet.

Show me the output

To view the output created before the error halted the execution of your script, click the button on the error page entitled “Show discarded response”.

Note that ScriptServer for some curious reason never displays the last character before the error occurs.




Published by: Henrik Weimenhög / scriptserver.com