Skip to content

Execution errors are missing in the executed signal #24

Open
@krassowski

Description

@krassowski

In upstream JupyterLab code KernelError information is included when execution fails

https://github.com/jupyterlab/jupyterlab/blob/653c22621f996249862093d0bb0f23b1279b0f52/packages/notebook/src/cellexecutor.ts#L94-L129

try {
  const reply = await CodeCell.execute(
    cell as CodeCell
    // ...
  );
  // ...

  ran = (() => {
    // ...
    if (reply.content.status === 'ok') {
      // ...
      return true;
    } else {
      throw new KernelError(reply.content);
    }
  })();
} catch (reason) {
  if (cell.isDisposed || reason.message.startsWith('Canceled')) {
    ran = false;
  } else {
    onCellExecuted({
      cell,
      success: false,
      error: reason
    });
    throw reason;
  }
}

if (ran) {
  onCellExecuted({ cell, success: true });
}

This is not the case with jupyter-server-nbmodel which omits the error information:

const data = await response.json();
success = data['status'] === 'ok';
} catch (error: unknown) {
onCellExecuted({
cell,
success: false
});
if (cell.isDisposed) {
return false;
} else {
throw error;
}
}
onCellExecuted({ cell, success });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions