Item14350: OopsException documentation has incorrect example.
Priority: Low
Current State: Closed
Released In: 2.1.4
Target Release: patch
Applies To: Engine
Component: Documentation
Branches: Release02x01 master
Item14288
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