gitbucket
gitbucket copied to clipboard
Provide user-friendly error message in Web API
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"
For sure, there is lack of user-friendly error message on Web APIs...
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.
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.
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.
Updated label and title.