Make DebugMode raise a better error when an optimization insert an op

that raise an error during computation.