Skip to content

Errors that code can throw

Rich Chiodo edited this page Jul 29, 2022 · 9 revisions

All of the errors thrown in the Jupyter extension that aren't unexpected should have a distinct class.

Example:

https://github.com/microsoft/vscode-jupyter/blob/442e539eff435fd182126f94cf550760d9e527b8/src/platform/errors/interactiveCellResultError.ts#L16

Each error should list:

  • Cause - what would cause this error to be thrown
  • Handled by - how the error is handled. This might be something like shown to the user or put in a cell or swallowed.

The list of errors is pretty easy to find by searching:

https://cs.github.com/?scopeName=All+repos&scope=&q=%22throw+new+%22+repo%3Amicrosoft%2Fvscode-jupyter+path%3Asrc%2F**%2F*.ts

That will also show throw new Error cases, but those are generally for unexpected conditions.

Clone this wiki locally