Merge "New hook ApiMain::onException"