TIP: Use Markdown or, <pre> for multi line code blocks / <code> for inline code.
These forums are read-only and for archival purposes only!
Please join our new forums at discourse.kohanaframework.org
Deploying Kohana 3.3
  • Hi, I am using 3.3 for my next project (previously used 3.2). The problem that I have relates to deployment, I have used the custom errors, but where how do I catch all none HTTP exceptions. I have forced a View_Exception and set the environment to production, but I am still getting the stack tree full error message, I would prefer to get my custom 500, with the actual error logged.

  • The idea is to only ever throw HTTP exceptions (i.e. catch others, and re-throw their info as HTTP ones).

    I think. ;-)

  • Hi, thanks for the responses. I am still confused by how Exceptions are handled in kohana.

    It may be me, but the exception handling seems too confusing. The Kohana_Exception is the base exception and the exception handler. Should these responsibilities not be in 2 separate classes (SIngle Responsibility Principle)?

    Also in the response code of Kohana_Exception talks about HTTP_Exception (a subclass), this does not seem elegant.

  • @royster,

    I am still confused by how Exceptions are handled in kohana.

    confused? naah... you seem to know what you're talking about ;)

    Should these responsibilities not be in 2 separate classes

    well, that's arguable. It's a static function after all, and you can put it in a separate class or any class you want. I am for keeping it there in Kohana_Exception, so you can always call Kohana_Exception::handle() if you want.

    Also in the response code of Kohana_Exception talks about HTTP_Exception (a subclass), this does not seem elegant.

    Yeah... well, that doesn't seem elegant... so we can't live with that? It is way more elegant now, than in version 3.2. At least you can use _handler() if you want, without exiting.

    Maybe the part where Kohana_Exception talks about HTTP_Exception should be overridden by Kohana_HTTP_Exception::response()? Go ahead to play with it, test and patch it, file a bug for 3.3.2 and issue a PR :)

    Cheers!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion