<!-- Welcome! Thank you for contributing. These HTML comments will not render in the issue. Before creating a new issue: * Search for relevant issues * Follow the JupyterLab issue reporting guidelines: https://jupyterlab.readthedocs.io/en/latest/getting_started/issue.html --> ## Description When a job fails with an exception inside a `%%time` magic cell, jupyter-scheduler does not recognize that the job actually failed. For example, this job is shown as completed:  But the HTML/Notebook output clearly shows that an exception was raised:  ## How to reproduce An exception is raised in a cell with `%%time` cell magic. ## Expected behavior Jobs where an exception is raised should be shown as failed, even when magic commands are used. ## Context <!--Complete the following for context, and add any other relevant context--> - Operating System and version: Linux Ubuntu 20.04 - JupyterLab version: 4.0.11 - Jupyter Scheduler version: 2.4.0