none
[openafs-wiki.git] / TWiki / TWikiOopsExceptionDotPm.mdwn
1 # <a name="Package &lt;code&gt;TWiki::_OopsException="></a> Package =TWiki::OopsException
2
3 **extends** `Error`
4
5 Exception used to raise a request to redirect to an Oops URL. An [[OopsException]] thrown anywhere in the code will redirect the browser to a url based on the `oops` script. `oops` requires a `template` parameter, that is the name of a template file from the `templates` directory. This file will be expanded and the parameter values passed to the exception instantiated. The result will be shown in the browser.
6
7 <div>
8   <ul>
9     <li><a href="#Package =TWiki::_OopsException="> Package TWiki::OopsException</a><ul>
10         <li><a href="#ClassMethod <strong>new</strong> ($template,..."> ClassMethod new <tt>($template,...)</tt></a></li>
11         <li><a href="#ObjectMethod <strong>stringify</strong> ([$sess"> ObjectMethod stringify <tt>([$session]) -&gt; $string</tt></a></li>
12       </ul>
13     </li>
14   </ul>
15 </div>
16
17 ## <a name="ClassMethod &lt;strong&gt;new&lt;/strong&gt; ($template,..."></a> [[ClassMethod]] **new** `($template,...)`
18
19 - `template` is the name of an oops template
20
21 The remaining parameters are interpreted as key-value pairs. The following keys are used:
22
23 - `web` will be used as the web for the oops
24 - `topic` will be used as the topic for the oops
25 - `def` - is the (optional) name of a TMPL:DEF within the template
26 - `keep` - if set, the exception handler should try it's damndest to retain parameter values from the query.
27 - `params` is a reference to an array of parameters. These will be substituted for %PARAM1%, %PARAM2% ... %PARAMn% in the template.
28
29 ## <a name="ObjectMethod &lt;strong&gt;stringify&lt;/strong&gt; ([$sess"></a> [[ObjectMethod]] **stringify** `([$session]) -> $string`
30
31 Generates a string representation for the object. if a session is passed in, and the excpetion specifies a def, then that def is expanded. This is to allow internal expansion of oops exceptions for example when performing bulk operations.