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

Provide user-friendly error message in Web API #2508

Open
gjb1002 opened this issue Aug 13, 2020 · 5 comments
Open

Provide user-friendly error message in Web API #2508

gjb1002 opened this issue Aug 13, 2020 · 5 comments
Labels
APIv3 GitHub compatible API

Comments

@gjb1002
Copy link

gjb1002 commented Aug 13, 2020

Issue

Impacted version: 4.33

Deployment mode: Apache Tomcat

Problem description:
I try to create an organization using the API, as described in
https://developer.github.com/v3/repos/#create-an-organization-repository

If I mistype the organization name and provide one that doesn't exist, I don't get a nice error message. I get "Internal Server Error 500" and an exception in the log, which starts with "java.util.NoSuchElementException: None.get"

@SIkebe SIkebe added the invalid label Aug 13, 2020
@takezoe
Copy link
Member

takezoe commented Aug 13, 2020

For sure, there is lack of user-friendly error message on Web APIs...

@gjb1002
Copy link
Author

gjb1002 commented Aug 14, 2020

I don't get it. Why would a web API not have error handling? Or at least the log have a comprehensible message? This kind of thing saves masses of time for new users.

@takezoe
Copy link
Member

takezoe commented Aug 14, 2020

You're right. It's simply due to the lack of development resource. Initially, because Web API was not a core feature of GitBucket, we started implementing it with minimum effort. Therefore, we didn't prepare a designed validation mechanism which allows providing user-friendly error messages at the beginning.

The consistent design for the error handling in the entire Web API should be done first. Recently, the number of users of Web API is increasing and we get many feedback and requests to Web API. So, it may be a time to invest in Web API improvement.

@gjb1002
Copy link
Author

gjb1002 commented Aug 14, 2020

OK, I see. Perhaps "Invalid" isn't the best label then. The Web API may not be a core feature, but for anyone migrating a non-trivial number of existing repositories from some other tool it's almost the first thing you use, as in my case.

@takezoe takezoe added APIv3 GitHub compatible API and removed invalid labels Aug 15, 2020
@takezoe takezoe changed the title Exception when trying to create repository under non-existent organisation using API Provide user-friendly error message in Web API Aug 15, 2020
@takezoe
Copy link
Member

takezoe commented Aug 15, 2020

Updated label and title.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIv3 GitHub compatible API
Development

No branches or pull requests

3 participants