{"record":{"id":"b800fa6a0e6586f5","repo":"microsoft/ailab","slug":"no-image-to-share","errorCode":null,"errorMessage":"no image to share","messagePattern":"no image to share","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"Snip-Insights/SnipInsight/AppManager.cs","lineNumber":1661,"sourceCode":"                }\n\n                // Try and open email client with attachment.\n                if (!EmailManager.OpenEmailClientWithEmbeddedImage(file, subject, attachmentName, \"image/png\"))\n                {\n                    File.Delete(file);\n                    bool success;\n                    // Do Work\n                    if (ViewModel.InkedImage != null)\n                    {\n                        success = ClipboardManager.Copy(ViewModel.InkedImage);\n                    }\n                    else if (ViewModel.CapturedImage != null)\n                    {\n                        success = ClipboardManager.Copy(ViewModel.CapturedImage);\n                    }\n                    else\n                    {\n                        throw new InvalidOperationException(\"no image to share\");\n                    }\n\n                    if (success)\n                    {\n                        string mailToImageFormat = \"mailto:?subject=\" + subject + \"&body=Capture copied to clipboard. please paste here\";\n                        Process.Start(mailToImageFormat);\n                    }\n                    else\n                    {\n                        ToastControl toast = new ToastControl(Resources.Message_CopyToClipboardFailed);\n                        toast.ShowInMainWindow();\n                    }\n                }\n            }\n            catch (Exception ex)\n            {\n                Diagnostics.ReportException(ex);\n            }","sourceCodeStart":1643,"sourceCodeEnd":1679,"githubUrl":"https://github.com/microsoft/ailab/blob/89fe2fc62081145ec5408d42059cbcb7c4a033c8/Snip-Insights/SnipInsight/AppManager.cs#L1643-L1679","documentation":"In the share workflow, AppManager must first materialize the current image to a temporary file to attach to an email; this error is the sentinel failure path when no shareable image exists. It fires when the email client could not be opened with the generated file and neither ViewModel.InkedImage nor ViewModel.CapturedImage is set — i.e. the user hit Share without any captured or inked image in the session.","triggerScenarios":"Thrown at Snip-Insights/SnipInsight/AppManager.cs:1661 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Guard the Share action: disable the Share button until an image has been captured or inked","Before sharing, check ViewModel.InkedImage and ViewModel.CapturedImage and show a user-facing message prompting to capture or annotate an image first","If an image exists but the temp file failed, regenerate the snapshot before retrying the email flow"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"89fe2fc62081145ec5408d42059cbcb7c4a033c8","analyzedAt":"2026-09-13T20:10:53.835Z","contentChangedAt":"2026-09-13T20:10:53.835Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}