code: def cell_exception(self, cell, cell_index=None, **kwargs):
          
          cell.metadata.papermill['exception'] = True
          cell.metadata.papermill['status'] = self.FAILED
          self.nb.metadata.papermill['exception'] = True
docs: Set metadata when an exception is raised.
  
          Called by engines when an exception is raised within a notebook to
          set the metadata on the notebook indicating the location of the
          failure.