plugins-workspace icon indicating copy to clipboard operation
plugins-workspace copied to clipboard

[clipboard] readText() returns 400 when empty

Open gschier opened this issue 1 year ago • 1 comments

I know this was intentional, because there's an error message, but should readText() return nothing when the clipboard is empty instead of throwing a 400? Or, perhaps there could be an alternative way to check the clipboard status that doesn't error.

I have an app that checks for something in the clipboard on window focus, and these console errors are difficult to see around.

CleanShot 2024-08-10 at 07 13 06@2x

gschier avatar Aug 10 '24 14:08 gschier

I don't really disagree with you but the crates we use throw the same error for emtpy data and wrong formats (i know i'm stating the obvious since that's what the error says). At first glance it looks like the OS apis don't make differentiating easy (not impossible though i think).

Since the invalid format part of the error may be important we can't do anything here for now. Marking this as an upstream issue.

FabianLars avatar Sep 03 '24 10:09 FabianLars