Skip to content

Make missing plugin repo errors more informative#4087

Merged
JoeKar merged 2 commits into
micro-editor:masterfrom
dmytrovoytko:dmytrovoytko-patch-1
Jun 1, 2026
Merged

Make missing plugin repo errors more informative#4087
JoeKar merged 2 commits into
micro-editor:masterfrom
dmytrovoytko:dmytrovoytko-patch-1

Conversation

@dmytrovoytko

Copy link
Copy Markdown
Contributor

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

JoeKar commented May 6, 2026

Copy link
Copy Markdown
Member

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

Neko-Box-Coder commented May 6, 2026

Copy link
Copy Markdown
Contributor

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

JoeKar commented May 6, 2026

Copy link
Copy Markdown
Member

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
Contributor 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)

@JoeKar

JoeKar commented May 7, 2026

Copy link
Copy Markdown
Member

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

Yes, better. The same applies to:

fmt.Fprintln(out, "Failed to decode repository data [", pr, "]:\n", err)

Which is quite long too with the causing plugin URL.

@dmytrovoytko

Copy link
Copy Markdown
Contributor Author

Fixed.
It would look like this now (in case 404 wasn't caught)

Skipped: https://notabug.org/dustdfg/micro-calc/raw/master/repo.json
 Reason: Failed to decode repository data
  invalid character '<' looking for beginning of value

Comment thread internal/config/plugin_installer.go Outdated
@dmytrovoytko

dmytrovoytko commented May 10, 2026

Copy link
Copy Markdown
Contributor Author

@JoeKar that's done, thank you. Anything else?

@JoeKar

JoeKar commented May 10, 2026

Copy link
Copy Markdown
Member

@JoeKar that's done, thank you. Anything else?

Just the fact that we have now 5 commits in the PR history, but we can squash them on merge.

@dmytrovoytko

Copy link
Copy Markdown
Contributor Author

@Neko-Box-Coder is there anything from your side on this?

@Neko-Box-Coder

Copy link
Copy Markdown
Contributor

@Neko-Box-Coder is there anything from your side on this?

Sorry for the late reply, missed this somehow. Nope, seems good to me. Appreciate your work.

@dmytrovoytko

Copy link
Copy Markdown
Contributor Author

@JoeKar is there any obstacle to merge this update?

Comment thread internal/config/plugin_installer.go
Comment thread internal/config/plugin_installer.go Outdated
Comment thread internal/config/plugin_installer.go Outdated
@dmytrovoytko dmytrovoytko force-pushed the dmytrovoytko-patch-1 branch from 9604b42 to 1c6b849 Compare May 30, 2026 21:38
Comment thread internal/config/plugin_installer.go Outdated
@dmytrovoytko dmytrovoytko force-pushed the dmytrovoytko-patch-1 branch from 759a11c to 147f2c1 Compare May 31, 2026 11:38
@JoeKar JoeKar merged commit b75cfc7 into micro-editor:master Jun 1, 2026
6 checks passed
@dmytrovoytko dmytrovoytko deleted the dmytrovoytko-patch-1 branch June 2, 2026 09:39
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.

4 participants