[studs-user] Error messages in Actions
Status: Beta
Brought to you by:
mojavelinux
|
From: <joh...@on...> - 2005-07-27 12:35:25
|
Hi,
While evaluating Studs, I'm trying to create error messages based on
Exceptions recieved in the Action, for transport along the request down
the PSP.
What I've tried to do is catch any exception and create a new
ActionMessages(), add messages to it, and then use
$this->saveErrors($request, $actionMessages):
$errorMessages = new ActionMessages();
$id = & $request->getParameter('id');
$manager =& new OManager();
try
{
$player =& $manager->getPlayer($id);
}
catch (NetworkNoResponseException $a_oE)
{
$errorMessages->add('error.network.noresponse',wrap('The
Network did not respond'));
$this->saveErrors($request, $errorMessages);
return $mapping->findForward('list');
}
This works.
However, when I try to read the messages in my PSP, using this code:
<html:messages id="message" message="false" scope="request">
<div class="errormessage">ERROR: <c:out value="${message}"/></div>
</html:messages>
I get the following error:
horizon.lang.RootException: Fatal error: Call to a member function getKey() on a non-object in C:\develsoft\Apache Group\Apache2\htdocs\basic\WEB-INF\lib\studs\taglib\html\HtmlMessagesTag.php on line 215
at horizon.lang.RootException.RootException(C:\develsoft\Apache Group\Apache2\htdocs\basic\WEB-INF\lib\horizon\lang\RootException.php:67)
at stratus.connector.HttpProcessor.fatalErrorWatchdog(C:\develsoft\Apache Group\Apache2\htdocs\basic\WEB-INF\lib\stratus\connector\HttpProcessor.php:328)
at [PHP].main(:)
And, on a sidenote, I frequently get "Documents contains no data". What could cause that error? I've noticed that it often occurs after 15 seconds, but my script timeout (for PHP) is set to 30 seconds. Does Studs alter this timeout?
Best Regards,
Johan Mjönes
--
Johan Mjönes
Programmer
Phone: +46 8 789 12 00
Fax: +46 8 789 12 12
Cell: +46 7 052 838 55
E-mail: joh...@on...
Internet: www.ongame.com
This e-mail (including attachments) is strictly confidential and intended solely for designated recipient(s). It contains privileged and confidential information. If you have received this e-mail in error, you must not disseminate, copy, distribute or take any action in reliance on it. Please notify us immediately and delete this e-mail and any attachments. Thank you.
|