How to stop the simulation only when specific errors occur

May be you can change that specific error to fatal :)

Thanks,
-Yashwanth