You are here: Foswiki>Tasks Web>Item14350 (01 Jun 2017, GeorgeClark)Edit Attach

Item14350: OopsException documentation has incorrect example.

pencil
Priority: Low
Current State: Closed
Released In: 2.1.4
Target Release: patch
Applies To: Engine
Component: Documentation
Branches: Release02x01 master Item14288
Reported By: BramVanOosterhout
Waiting For:
Last Change By: GeorgeClark
The documentation for Foswiki::OopsException states:
Extensions may throw Foswiki::OopsException. For example:

use Error qw(:try);

...

throw Foswiki::OopsException( 'bathplugin',
                            status => 418,
                            web => $web,
                            topic => $topic,
                            params => [ 'big toe', 'stuck in', 'hot tap' ] );

This will raise an exception that uses the bathplugin.tmpl template. If UI::run handles the exception it will generate a redirect to:
According to the documentation for the Class method new:
  • template is the name of an oops template. e.g. 'bathplugin' refers to templates/oopsbathplugin.tmpl

So the line
  • This will raise an exception that uses the bathplugin.tmpl template. If UI::run handles the exception it will generate a redirect to: should read
  • This will raise an exception that uses the oopsbathplugin.tmpl template. If UI::run handles the exception it will generate a redirect to: emphasis mine

Other references to the template bathplugin.tmpl on the page should also change to oopsbathplugin.tmpl

I do not have access to the page.

-- BramVanOosterhout - 23 Mar 2017

Thanks for the point-out. The documentation for this page is actually generated from in-line examples in the Foswiki/OopsException.pm module. So this needs a source code fix. If you have a github account, you could fix it there and issue a pull request. But I'll get it fixed.

-- GeorgeClark - 23 Mar 2017
 
Topic revision: r5 - 01 Jun 2017, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy