fyne-io / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
223 stars 41 forks source link

Return errors instead of using log.Printf in library code #35

Open derberni opened 1 year ago

derberni commented 1 year ago

At a couple of places, the current implementation does not return an error when something fails, but instead does something like the following (taken from systray_windows.go, MenuItem.SetIcon)

    if err != nil {
        log.Printf("systray error: unable to write icon data to temp file: %s\n", err)
        return
    }

However, we would like to handle the error in our own application (and not log it at all). One might even argue, that a library should not write any log messages at all, and only return errors to the main application.

Any chance of a PR changing this behavior getting accepted? After all, it would break backwards compatibility because the function signatures would change from e.g. SetIcon(iconBytes []byte) to SetIcon(iconBytes []byte) error