On 2013-02-07 16:13, Heikki Vatiainen wrote: > On 02/05/2013 08:39 PM, Alexander Hartmaier wrote: > >> I've looked into it today and have some questions: >> - is it safe to assume that the list or arguments passed to the >> ChallengeHook in my case is always ($self, $user, $p, $context)? >> If one arg is missing my added arguments would shift and populate the >> wrong variables. I was thinking about passing them by name in a hashref >> as first instead of last argument instead. > Passing your arguments first would certainly work and would guard > against the problems that might come if arguments were added or removed > from ChallengeHook. > > I'd say it's a good idea to put your own arguments first. Will do that, thanks! > >> - is it safe to die in hook code or will that tear down the Radiator >> process? I'm asking because that's the preferred way of doing argument >> validation, e.g. >> die 'id missing' >> unless defined $id; > It should be safe since hooks are run within eval block and if there are > errors, they are caught and ERR with 'Error in $hookname...' is logged. Is that documented somewhere? Couldn't find it the docs. > >> Another note, I've used %D instead of the hardcoded path which works >> just as well: >> >> StartupHook sub { require "%D/MyHooks.pm"; } > Based on your other messages, there were issues with this which were > then solved. Is everything working for you now? > > Thanks, > Heikki > %D doesn't work, but my problem arised when I changed the StartupHook from a single line to multiple lines without terminating them with \. Works now but it would be great if Radiator logged such an error.
Cheers, Alex *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien Handelsgericht Wien, FN 79340b *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* Notice: This e-mail contains information that is confidential and may be privileged. If you are not the intended recipient, please notify the sender and then delete this e-mail immediately. *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"* _______________________________________________ radiator mailing list radiator@open.com.au http://www.open.com.au/mailman/listinfo/radiator