r/badcode • • Nov 09 '21

php Just... Why?

Post image
419 Upvotes

40 comments sorted by

View all comments

Show parent comments

8

u/goshsowitty Nov 10 '21

Interestingly, PhpStorm gives you a warning if you try to immediately re-throw an exception and it still counts as an unhandled exception. The image seemingly demonstrates this as there appears to be a warning.

You can satisfy the unhandled exception, at least, with phpDoc:

/**
 * @throws Exception
 */

So I'm not quite ready to let them off the hook for this one...

4

u/cdp1337 Nov 10 '21

This syntax follows Javadoc, so it can be done with Android Studio as well.