Skip to content

Make missing plugin repo errors more informative#4087

Open
dmytrovoytko wants to merge 3 commits intomicro-editor:masterfrom
dmytrovoytko:dmytrovoytko-patch-1
Open

Make missing plugin repo errors more informative#4087
dmytrovoytko wants to merge 3 commits intomicro-editor:masterfrom
dmytrovoytko:dmytrovoytko-patch-1

Conversation

@dmytrovoytko
Copy link
Copy Markdown

Thank you for this great editor!
Please consider this update to handle missing plugin repo errors better.
It addresses #1276

Plugins in official channel are ok now (may change someday), but 3 plugins of unofficial channel are missing and it shows up as strange messages while running micro -plugin available or other plugin commands:

Failed to decode repository data:
 json: cannot unmarshal number into Go value of type config.PluginPackages
Failed to decode repository data:
 invalid character '<' looking for beginning of value
Failed to decode repository data:
 invalid character '<' looking for beginning of value

Instead it would show up like this:

Skipped: Plugin repository not found at https://raw.githubusercontent.com/cadnza/mxc/main/repo.json (Status Code: 404).
Skipped: Plugin repository not found at https://notabug.org/dustdfg/micro-calc/raw/master/repo.json (Status Code: 404).
Skipped: Plugin repository not found at https://notabug.org/dustdfg/micro-mdtree/raw/master/repo.json (Status Code: 404).

@JoeKar
Copy link
Copy Markdown
Member

JoeKar commented May 6, 2026

I think these fmt.Fprintf() logs might become quite long.
What about:

fmt.Fprintf(out, "Skipped: %s\n", pr)
fmt.Fprintf(out, "Reason: XYZ (Status Code: %d)\n", statusCode)

?

@Neko-Box-Coder:

3 plugins of unofficial channel are missing

Something to consider for your?

@Neko-Box-Coder
Copy link
Copy Markdown
Contributor

Neko-Box-Coder commented May 6, 2026

This is quite similar to one of my (forgotten) PRs.

@Neko-Box-Coder:

3 plugins of unofficial channel are missing

Something to consider for your?

The upstream for all those 3 are all gone/archived :(

It's an annoying error but any plugin actions are not affected (Apart from interacting from these 3 plugins ofc).
I will need to update the json for these plugins to point to my stable branch. I am slightly busy now but will try to sort it out asap.

@JoeKar
Copy link
Copy Markdown
Member

JoeKar commented May 6, 2026

This is quite similar to one of my (forgotten) PRs.

Oh, damn.
Well, both have their own advantages. 🤔

@Neko-Box-Coder
Copy link
Copy Markdown
Contributor

To be fair, my PR was also doing something else.

We can merge this and I can adjust my PR.

My PR was also trying to do a reasonable timeout such that a git repo with very slow/unstable connection (notabug was one of them I believe, potentially codeburg as well) won't block the rest of the plugins.

@dmytrovoytko
Copy link
Copy Markdown
Author

I think these fmt.Fprintf() logs might become quite long. What about:

fmt.Fprintf(out, "Skipped: %s\n", pr)
fmt.Fprintf(out, "Reason: XYZ (Status Code: %d)\n", statusCode)

?

Now it would look like this (better, thanks!)

Skipped: https://raw.githubusercontent.com/cadnza/mxc/main/repo.json
 Reason: Plugin repository not found (Status Code: 404)
Skipped: https://notabug.org/dustdfg/micro-calc/raw/master/repo.json
 Reason: Plugin repository not found (Status Code: 404)
Skipped: https://notabug.org/dustdfg/micro-mdtree/raw/master/repo.json
 Reason: Plugin repository not found (Status Code: 404)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants