catch exceptions in slice compiler