{"record":{"id":"0694def0615515fc","repo":"flxzt/rnote","slug":"engine-snapshot-has-no-value-document","errorCode":null,"errorMessage":"`engine_snapshot` has no value `document`.","messagePattern":"`engine_snapshot` has no value `document`\\.","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs","lineNumber":23,"sourceCode":"\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub struct RnoteFileMaj0Min13 {\n    /// A snapshot of the engine.\n    #[serde(rename = \"engine_snapshot\")]\n    pub engine_snapshot: ijson::IValue,\n}\n\nimpl TryFrom<RnoteFileMaj0Min9> for RnoteFileMaj0Min13 {\n    type Error = anyhow::Error;\n\n    fn try_from(mut value: RnoteFileMaj0Min9) -> Result<Self, Self::Error> {\n        let engine_snapshot = value\n            .engine_snapshot\n            .as_object_mut()\n            .ok_or_else(|| anyhow::anyhow!(\"engine snapshot is not a JSON object.\"))?;\n        let document = engine_snapshot\n            .get_mut(\"document\")\n            .ok_or_else(|| anyhow!(\"`engine_snapshot` has no value `document`.\"))?\n            .as_object_mut()\n            .ok_or_else(|| anyhow!(\"`document` is not a JSON object.\"))?;\n\n        let format = document\n            .remove(\"format\")\n            .ok_or_else(|| anyhow!(\"document has no value `format`.\"))?;\n        let background = document\n            .remove(\"background\")\n            .ok_or_else(|| anyhow!(\"document has no value `background`.\"))?;\n        let layout = document\n            .remove(\"layout\")\n            .ok_or_else(|| anyhow!(\"document has no value `layout`.\"))?;\n        // discard `snap_positions`, this config is now global.\n        document.remove(\"snap_positions\");\n\n        let mut document_config = ijson::IObject::new();\n        document_config.insert(\"format\", format);\n        document_config.insert(\"background\", background);","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/flxzt/rnote/blob/bbc5354502ba2fc83eec2670b535348825e679a6/crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs#L5-L41","documentation":"Wrapper in export_doc_as_pdf_bytes: cairo_cx.show_page() returned an Err while emitting page i of the PDF, i.e. cairo failed to finalize that page onto the PDF target surface. Any cairo-level failure during PDF page output surfaces through this mapping.","triggerScenarios":"Thrown at crates/rnote-engine/src/fileformats/rnoteformat/maj0min13.rs:23 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run the export; cairo surface-state errors can be transient.","Verify the PDF target surface and output stream are valid and writable.","Inspect the cairo error variant carried in `e` for the underlying cairo status."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bbc5354502ba2fc83eec2670b535348825e679a6","analyzedAt":"2026-09-08T13:20:33.747Z","contentChangedAt":"2026-09-08T13:20:33.747Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}