cancel
Showing results for 
Search instead for 
Did you mean: 

Friendly Error Pages

jvanderhoef
Champ in-the-making
Champ in-the-making
I have been researching a way to create and maintain a set of friendly error pages for my site which is currently running under Alfresco 2.9. The site relies mainly on webscripts for creation of its pages. I have found where I can create response templates within each webscript, but I would like to be able to have all 500, 401, 404, etc errors return a pre-defined "friendly" error page without having to configure responses for every individual webscript.

Is there a global configuration somewhere this can be managed?  Thanks much.
4 REPLIES 4

rogier_oudshoor
Champ in-the-making
Champ in-the-making
You can use the webscript system to provide an FTL per status, for instance named 404.html.ftl

Every webscript returning a 404 from it's controller (and which has gotten a redirect set!) will use this template.

jvanderhoef
Champ in-the-making
Champ in-the-making
Thank you for your response, that worked fine. I was actually trying that but it didn't work unitl I refreshed my webscripts….duh.

scottf
Champ on-the-rise
Champ on-the-rise
Hi,
Can either of you provide an example?

For a particular webscript I created I am getting a 500 status code returned.
I created a "500.html.ftl" and placed in the same folder as my webscript, refreshed all webscripts. When I get the error message it is still not picking up the "500.html.ftl" file I created.
Do I need to specify something in the webscript .js file?
At the moment I use this code when I catch the error:
status.code = 500;
      status.message = err.message;
        status.redirect = true;

Thanks very much.

scottf
Champ on-the-rise
Champ on-the-rise
Nevermind Smiley Happy

Found the problem.

I renamed my 500.html.ftl file to 500.ftl and it works great.

Thanks for the tip.