Error Handling in Shader Widget

I made further steps regarding my experiments to import a dmabuf texture into iced (Request a vulkan renderer with a device extension - #3 by m0ppers). Everything is working properly and I am happy :smiley: however I am completely on my happy path now. Namely there are situations where the creation of my dmabuf texture is not working. My base setup is derived from the custom_shader example. Now I have a pipeline.rs which does this in its new() function:

        let texture_view =
            create_texture_view_from_texture_metadata(device, texture_metadata).unwrap();

this is doing the dmabuf import and it might fail due to various reasons as it is doing unsafe vulkan in the background.

Now how would I do error handling there? The Shader widget doesn’t have any interaction points that would return a Result.

I could also do the texture importing in my main program logic. However there I don’t have the wgpu context (or I don’t know how I could get that?).

Ultimately I would like to show a text widget with the error message instead of the shader widget in that case.

Any ideas?