Ported exception hook