Item442: Throwing a OopsException can now be done with an message by argument
Priority: Enhancement
Current State: Closed
Released In: 1.0.0
Target Release: patch
Adding the possibility to pass the massage to be shown by a
OopsException as a parameter.
This is useful, because the other way around, every plugin has to define its own template ( which the user has to use.. ) to be able to show a message, because message.tmpl needs a "additional" string which can only be "added" this way.
So i added a parameter, showmessage, which expands %MESSAGEASPARAMETER% in the oops.tmpl.
Now, the plugin can use def to use a predefined message(cool for translations) or simply use a message which is passed by argument.
This message can still include %PARAM1% ..., they get expanded properly
Important: Its still backwards compatible, so all
OopsExceptions which have been thrown yet are working properly and do not get influenced. Its only a addition to the current bit unhandy system
I also think about adding a default "back" button to the default oops.tmpl, because yet, casua users are simply lost in space then
There is an existing generic oops message.
throw
OopsException('attention', def => 'generic', params => [ 'Your parameters' ]);
No new parameters are required. Nor does any plugin have to define it's own template.
Or am I missing what you are trying to say?
After a short discussion in the IRC Crawford just showed me how users can post such messages :
throw
OopsException('attention', def => 'generic', params => [ 'your message $var with $foo' ], "annother part of the massage");
that one gets displayed by :
oopsattention->generic is defined as:
%TMPL:DEF{"generic"}% %PARAM1% %PARAM2% %PARAM3% %PARAM4% %TMPL:END%
Conclusion: Reverting changes, looking up the docs where it is / could be documentated
Imporved the doc. See
DevelopingPlugins and follow the link to Foswiki::OopsException