Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution errors are missing in the executed signal #24

Open
krassowski opened this issue Aug 5, 2024 · 0 comments
Open

Execution errors are missing in the executed signal #24

krassowski opened this issue Aug 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@krassowski
Copy link
Collaborator

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 });

@krassowski krassowski added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant