You are here: Foswiki>Tasks Web>Item442 (22 Feb 2009, KennethLavrsen)Edit Attach

Item442: Throwing a OopsException can now be done with an message by argument

pencil
Priority: Enhancement
Current State: Closed
Released In: 1.0.0
Target Release: patch
Applies To: Engine
Component: OopsException
Branches:
Reported By: Foswiki:Main.EugenMayer
Waiting For:
Last Change By: KennethLavrsen
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

ItemTemplate edit

Summary Throwing a OopsException can now be done with an message by argument
ReportedBy Foswiki:Main.EugenMayer
Codebase trunk
SVN Range TWiki-4.2.3, Wed, 06 Aug 2008, build 17396
AppliesTo Engine
Component OopsException
Priority Enhancement
CurrentState Closed
WaitingFor
Checkins distro:f804f53389f6 distro:e3f42f7d6d3c distro:81c59427be88 distro:35e990a6f63f distro:0b8b911aa729
TargetRelease patch
ReleasedIn 1.0.0
Topic revision: r11 - 22 Feb 2009, KennethLavrsen
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