On 4/19/10 1:32 AM, Craig Andrews wrote:
I committed to 1.0.x the changes necessary to use PHP exceptions for PEAR
error handling. This will allow core and plugins to catch PEAR exceptions,
which will allow us to fix a few previously unfixable issues (such as
allowing files of mime types unknown to MIME_Type to be uploaded) and
allow for some code cleanup (I'm thinking specifically of the LDAP
plugins, but there are other places, too).

There are some known issues with this code now, but nothing we can't
fix... See the comments at
http://gitorious.org/statusnet/mainline/merge_requests/131 for an example.

I think this is the perfect example of something to be in for the next
version... so here goes.

Woohoo!

We do want to watch out for any cases of 'surprise exceptions' where existing code (especially in third-party libraries) are expecting to receive and process or ignore PEAR_Error items internally, where a higher-level try/catch block will leave the following code un-run.

If we do find them, we can fix that by wrapping calls to such code with a temporary switch of the error handling mode (preferably encapsulated in a function or method call). In the vast majority of cases though, the exception behavior is going to be what we want so that's a much nicer default!

-- brion
_______________________________________________
StatusNet-dev mailing list
[email protected]
http://lists.status.net/mailman/listinfo/statusnet-dev

Reply via email to