[TYPO3-mvc] New feature:
Jochen Rau
jochen.rau at typoplanet.de
Wed Mar 31 12:44:18 CEST 2010
Hi Lienhart.
On 31.03.10 10:24, Lienhart Woitok wrote:
> 1. Setting Development context does not work for me. I suspect running php as cgi to be responsible for this. I have (according to phpinfo()) an environment variable REDIRECT_EXTBASE_CONTEXT, but this one isn't read by Extbase, thus falling back to production context. For now, I hardcoded development context in Dispatcher, but this is obviously not a final solution.
Fixed with the latest rev.
> 2. Showing exceptions and stack traces to the end user is a no-go, no question on that. But displaying simply nothing isn't the solution either. Some kind of error message is necessary. How should the end user know that anything went wrong and how he/she can recover from this situation or who to inform about the issue?
What to display if an error occurs inside an extension depends upon your
needs. The patch adds just another possibility. If you want to have the
same behavior than before, just set the context to "Development" or "Foo".
If you set the context to "Production" (default) and an Exception is
thrown inside the Extbase based extension
- the page is shown (IMO user-friendly),
- the plugin content is empty. (This should be changed in the future to
be able to assign a custom exception handler. The handler can write
"Sorry, the service is temporarily unavailable." at place of the plugin
content or throw the Exception again to be catched by the top level
exception handler of TYPO3) and
- the Exception message and stack trace is written to the log (developer
friendly).
> TYPO3 has an production exception handler that AFAIK doesn't discloses internal information to the end user but informs him/her that an error occurred.. So as far as I'm concerned, letting TYPO3 decide what to do with exceptions thrown by Extbase would be more user friendly. Simply suppressing output is not very friendly to the developer (especially if switching to development context does not work reliable in all environments), as it leaves him with virtually no other choice than to wrap each action into a try/catch if he wants some custom exception handling in production context.
Wrapping a try-catch-block around critical code is IMO a good solution.
Regards
Jochen
More information about the TYPO3-project-typo3v4mvc
mailing list