[ticket/12043] Correct try/catch exceptions for invalid extensions

PHPBB3-12043