Generalized try/catch block generation for throwing instructions