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

[REQ] [maven] improve error message when <inputSpec> cannot be loaded/found #18947

Open
tomsit-ionos opened this issue Jun 17, 2024 · 0 comments

Comments

@tomsit-ionos
Copy link

Is your feature request related to a problem? Please describe.

Disclaimer: it's not a feature nor a bug, but an improvement but i didnt see that option.

When the <inputSpec> cannot be loaded from an URL (in my case when access permission is missing) there's a huge stacktrace, like so:

java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml
    at ... lots of stack frames ...
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml
[WARNING] Exception while reading:
io.swagger.v3.parser.exception.ReadContentException: Unable to read location `https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml`
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml at ... lots of stack frames ...
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml
    at ... lots of stack frames ...
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml
    at ... lots of stack frames ...
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml
    at ... lots of stack frames ...
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml
    at ... lots of stack frames ...
Caused by: java.io.FileNotFoundException: https://raw.githubusercontent.com/my-repo/foo/bar/v0.ea.yml java.lang.NullPointerException: Cannot invoke "io.swagger.v3.oas.models.OpenAPI.getExtensions()" because "openAPI" is null
    at ... lots of stack frames ...
java.lang.NullPointerException: Cannot invoke "io.swagger.v3.oas.models.OpenAPI.getExtensions()" because "openAPI" is null
    at ... lots of stack frames ...

Reading this usually from the bottom up, it hard to graps what the problem is w/o going all the way up and not overlooking the relevant: java.io.FileNotFoundException:
Especially when the URL is correct but one lacks the proper token -- or in my case used a tag or branch that disappeared.

Describe the solution you'd like

In the meanwhile I have learned this, but for the new comers it would be helpful to have a more telling/verbose error message it at the bottom/last Exception

Smth. along these lines:

Error: <inputSpec> @ ${path/url} cannot be loaded (URL returned 404).

If there is an <auth> config'ed, then also add a hint like so:

You have provided an `<auth>` config. In some cases insufficient authorizations are reported as 404s.

Describe alternatives you've considered

n/a

Additional context

n/a

@tomsit-ionos tomsit-ionos changed the title [REQ] [maven] improve exception when <inputSpec> cannot be loaded/found [REQ] [maven] improve error message when <inputSpec> cannot be loaded/found Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant