blog.Resource

Archive:

News-Feeds:


RSS 2.0
RSS 0.91
RDF
ATOM 0.3
January 22, 2008

Exceptional usefulness

Category: Robert Lemke, TYPO3

By: Robert Lemke

An exception was thrown

The wiki page with details about the exception

Probably many of you know that feeling: You're working with a product like TYPO3 and you've got a great idea for a new feature. A very small one, would probably easy to implement and is that sort of would-be-cool-if-we-had-that feature.

One thing I always wanted to implement for five-zero is some advanced error / exception handling. What if you, as a developer, wouldn't get a plain PHP error but a detailed report of what went wrong. A nice backtrace along with the arguments which were passed to each method.

I implemented such an exception handler a while ago for the _UNKNOWN3_ framework (checkout that first screenshot). It turned out to be very helpful in the course of development, you instantly get the idea what went wrong (well, in most cases at least).

Now, "wouldn't it be cool" if you could get some more information about the exception and read what other users did to solve the problem? Wouldn't be a wiki the right place for this information?

Our exception handler now renders a little link along with each exception. Just click on it and you'll be transfered to a matching page in the TYPO3 wiki. Because we didn't want to hardcode the wiki page address, we created a softlink for that purpose. typo3.org/go/exception/1166550023 will bring you directly to the wiki.typo3.org page for exception number 1166550023. On that page you find further information about who created the exception and what he thinks could help you solve the problem. Further more you can read other developer's comments or add your own.

So apparently all exceptions have a number. But how can I get a fresh number for my own exception? The answer is: exception codes are just timestamps. Just get yourself a current timestamp and check if a wiki page exists with that number. If not, you can just use that number and create a new page with the exception details.

So, no big deal, this feature, but one I always wanted. And by the great help of Daniel Brüßler we now have some proper templates for that in the wiki, too.


comments

comment #1
Gravatar: Andreas Gaisbauer Andreas Gaisbauer January 22, 2008 19:08
This is such a cool idea - absolutly love it!

comment #2
Gravatar: Ingo Ingo January 22, 2008 20:42
We're using that timestamp concept in 4.2, too already!

comment #3
Gravatar: Jonas Jonas January 23, 2008 09:47
That's realy cool.

In two years, when I'm doing a big _UNKNOWN_3 based project and I find a funy exception like 1201059903, I'll check the timestamp. So if the time was like 4:00 in the morning I'll know why the exception is funny ;-).

That gives like a connection to the developer which made the exception. You can imagine how he sat there with his coffee and tired eyes....

Great idea! Let's to software archeology.


comment #4
Gravatar: Daniel Pötzinger Daniel Pötzinger January 25, 2008 01:39
Hey cool - and good to here news about 5.0 and Beer3...

comment #5
Gravatar: Pierre Rouwens Pierre Rouwens January 30, 2008 05:17
Hi Robert,

This is such a great idea.
As Jonas, I guess it's gonna be really funny to check at what time the error page was corresponding. Pretty sure, I'm gonna check one just for fun :)

Pierre

comment #6
Gravatar: Michael Kramer Michael Kramer February 13, 2008 21:29
Hey!
I really like to do a big thank to your work on 5.0
Something I appreciate very much is: your profound, studied work.

Your friend
Michael

Sorry, comments are closed for this post.