Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better handle typos in jbang catalog #1780

Open
maxandersen opened this issue Mar 31, 2024 · 0 comments
Open

better handle typos in jbang catalog #1780

maxandersen opened this issue Mar 31, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@maxandersen
Copy link
Collaborator

forgot to add a ',' in a json and I got this:

jbang catalog list jbanghub/eclipse
[jbang] [ERROR] Unable to download catalog: https://github.com/jbanghub/eclipse/blob/HEAD/jbang-catalog.json via null
[jbang] Run with --verbose for more details

not very informative. --verbose gives a bit more.

manderse@goldentiny s % jbang catalog list --verbose jbanghub/eclipse
[jbang] [0:189] jbang version 0.115.0
[jbang] [0:196] Reading catalog from /Users/manderse/.jbang/jbang-catalog.json
[jbang] [0:238] Using cached file /Users/manderse/.jbang/cache/urls/fa06f056bd9cf8e061116f81e22c41b4f34a625bf6ca06b134c9e2ef300246d3/jbang-catalog.json for remote https://raw.githubusercontent.com/jbanghub/jbang-catalog/HEAD/jbang-catalog.json
[jbang] [0:238] Reading catalog from https://github.com/jbanghub/jbang-catalog/blob/HEAD/jbang-catalog.json
[jbang] [0:239] Obtained catalog from https://github.com/jbanghub/jbang-catalog/blob/HEAD/jbang-catalog.json
[jbang] [0:240] Using cached file /Users/manderse/.jbang/cache/urls/0f56633befec550f5330066df1f5f47112bdc7a0ddfc957b627bf3fbde5fa0bc/jbang-catalog.json for remote https://raw.githubusercontent.com/jbanghub/eclipse/HEAD/jbang-catalog.json
[jbang] [0:240] Reading catalog from https://github.com/jbanghub/eclipse/blob/HEAD/jbang-catalog.json
[jbang] [0:242] [ERROR] Unable to download catalog: https://github.com/jbanghub/eclipse/blob/HEAD/jbang-catalog.json via null
dev.jbang.cli.ExitException: Unable to download catalog: https://github.com/jbanghub/eclipse/blob/HEAD/jbang-catalog.json via null
	at dev.jbang.catalog.Catalog.getByRef(Catalog.java:212)
	at dev.jbang.catalog.Catalog.getByName(Catalog.java:145)
	at dev.jbang.cli.CatalogList.doCall(Catalog.java:166)
	at dev.jbang.cli.BaseCommand.call(BaseCommand.java:145)
	at dev.jbang.cli.BaseCommand.call(BaseCommand.java:21)
	at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
	at picocli.CommandLine.access$1300(CommandLine.java:145)
	at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2358)
	at picocli.CommandLine$RunLast.handle(CommandLine.java:2352)
	at dev.jbang.cli.JBang$3.handle(JBang.java:148)
	at dev.jbang.cli.JBang$3.handle(JBang.java:143)
	at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
	at picocli.CommandLine$RunLast.execute(CommandLine.java:2316)
	at picocli.CommandLine.execute(CommandLine.java:2078)
	at dev.jbang.Main.main(Main.java:14)
Caused by: com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated object at line 11 column 8 path $.aliases..description
	at com.google.gson.Gson.fromJson(Gson.java:1241)
	at com.google.gson.Gson.fromJson(Gson.java:1137)
	at com.google.gson.Gson.fromJson(Gson.java:1075)
	at dev.jbang.catalog.Catalog.read(Catalog.java:360)
	at dev.jbang.catalog.Catalog.read(Catalog.java:350)
	at dev.jbang.catalog.Catalog.get(Catalog.java:315)
	at dev.jbang.catalog.Catalog.getByRef(Catalog.java:190)
	... 14 more
Caused by: com.google.gson.stream.MalformedJsonException: Unterminated object at line 11 column 8 path $.aliases..description
	at com.google.gson.stream.JsonReader.syntaxError(JsonReader.java:1659)
	at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:500)
	at com.google.gson.stream.JsonReader.hasNext(JsonReader.java:422)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:387)
	at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
	at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:186)
	at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:144)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
	at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
	at com.google.gson.Gson.fromJson(Gson.java:1227)
	... 20 more
[jbang] [0:242] If you believe this a bug in jbang, open an issue at https://github.com/jbangdev/jbang/issues
manderse@goldentiny s %

should be some more informative and explain at least there was a parse error in document at

@maxandersen maxandersen added the bug Something isn't working label Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant