Skip to content

Update image viewer to return an actual error #210

@digitalghost-dev

Description

@digitalghost-dev

The image viewer was treating error strings from CardImage as image data and rendering them as if they were sixel output. The flow needs to be updated so that errors are shown as errors and image data is only rendered when the fetch succeeds.

imageReadyMsg now includes err alongside sixelData
fetchImageCmd returns imageReadyMsg{err: err} on failure and leaves sixelData empty
ImageModel.Update sets m.Error on failure and only sets m.ImageData on success
ImageModel.View renders a styled error when m.Error is present; otherwise renders the image data

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug/fixSomething isn't working or needs updating.refactorRefactoring existing code.

    Projects

    Status

    Completed

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions