jtool_notebook/
error.rs

1use thiserror::Error;
2
3#[derive(Debug, Error)]
4pub enum NotebookError {
5    #[error("Invalid notebook format: {0}")]
6    InvalidFormat(String),
7
8    #[error("Cell index {0} out of bounds (notebook has {1} cells)")]
9    CellIndexOutOfBounds(usize, usize),
10
11    #[error("Unsupported nbformat version: {0}.{1}")]
12    UnsupportedVersion(u32, u32),
13
14    #[error("I/O error: {0}")]
15    Io(#[from] std::io::Error),
16
17    #[error("JSON error: {0}")]
18    Json(#[from] serde_json::Error),
19}