Zend Framework

echo exception message in the code

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.4
  • Fix Version/s: 1.9.5
  • Component/s: Zend_Rest_Server
  • Labels:
    None
  • Fix Version Priority:
    Nice to Have

Description

Specifically, SVN revision 18493 (branch 1.8) also seems to be in trunk.

Line 595 (601 in trunk) catches exception caused when creating an object. The exception gets caught but there is a statement which echo's the exception message. This shouldn't be there. It causes problems for other content returned, like headers and correctly formed XML.

Also the message from the exception is completely lost.

Activity

Hide
Satoru Yoshida added a comment -

Hi, Luke.
Do you also need to change parameter of next throw ?

new Zend_Rest_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $this->_functions[$this->_method]->getName(), 500);
Show
Satoru Yoshida added a comment - Hi, Luke. Do you also need to change parameter of next throw ?
new Zend_Rest_Server_Exception('Error instantiating class ' . $class . ' to invoke method ' . $this->_functions[$this->_method]->getName(), 500);
Hide
Luke Richards added a comment -

Hi,

I think so, unless there is a good reason not to it would be a good idea to change it to include the message from the caught exception.

I'm not sure what exactly but something like:
<code>
new Zend_Rest_Server_Exception('Error instantiating class ' . $class . ' (' . $e->getMessage() . ')', 500);
</code>

I hope that helps.

Show
Luke Richards added a comment - Hi, I think so, unless there is a good reason not to it would be a good idea to change it to include the message from the caught exception. I'm not sure what exactly but something like: <code> new Zend_Rest_Server_Exception('Error instantiating class ' . $class . ' (' . $e->getMessage() . ')', 500); </code> I hope that helps.
Hide
Satoru Yoshida added a comment -

Thank you for comment, Luke.

I remove echo and add $e->getMessage() to throw parameter at SVN trunk 18544.

Show
Satoru Yoshida added a comment - Thank you for comment, Luke. I remove echo and add $e->getMessage() to throw parameter at SVN trunk 18544.
Hide
Satoru Yoshida added a comment -

Hi, Dolf. I find you changed Assignee after my commit.
Do you have any idea on this issue?
I will reopen this issue for you.

Show
Satoru Yoshida added a comment - Hi, Dolf. I find you changed Assignee after my commit. Do you have any idea on this issue? I will reopen this issue for you.
Hide
Satoru Yoshida added a comment -

Change status because no responce in several days.

Show
Satoru Yoshida added a comment - Change status because no responce in several days.
Hide
Dolf Schimmel (Freeaqingme) added a comment -

My bad. Wasn't aware I assigned this issue to me, let alone why...

Show
Dolf Schimmel (Freeaqingme) added a comment - My bad. Wasn't aware I assigned this issue to me, let alone why...
Hide
Satoru Yoshida added a comment -

I see, Dolf. Never mind

Show
Satoru Yoshida added a comment - I see, Dolf. Never mind

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: