Capture RuntimeError.