Avoid direct recursion when computing the exceptions of a method.