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 contextual error messages, not “Internal exception occurred” #219
Comments
Can we list all the different cases that need to be handled? This will be transferred into a PR once we start working on it.
|
On 01-Nov-2016, Mohamed Zenadi wrote:
I think the comprehensive approach is not to enumerate failure cases, Any use of jgit should catch jgit exceptions, and provide context at So the list of tasks is IMO to be found by enumerating all the Catch any jgit exception that occurs at that location. Annotate the The “this specific action” should be whatever the user needs to know
Thanks. \ “Consider the daffodil. And while you're doing that, I'll be | |
Well, in fact there is a single place where jgit is used https://github.com/zeapo/Android-Password-Store/blob/master/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java#L65-L85 That's the place where we ought to handle the different cases. The command being handled is known at https://github.com/zeapo/Android-Password-Store/blob/master/app/src/main/java/com/zeapo/pwdstore/git/GitAsyncTask.java#L42 and the result is returned in as a The list I started to define earlier is only meant for a better description / documentation of the issue. We also have to check in eclipse git plugin how the implemented exceptions handling for jgit errors. The issue here is that the project in its current state is not easily maintainable, a lot of refactoring has to be done, and I have not much time to do it on my own. |
On 06-Nov-2016, Mohamed Zenadi wrote:
Thanks. If I understand correctly, that is a wrapper to execute the So I think that location in the code does not have the context
I think the exception should not be caught in that function; as you Instead, the exception should propagate to a point where the code
As a rough guide – and, importantly, an easy criterion – I would say a All the places in the code that invoke a GitAsyncTask. Catch the That can be refined further, but it would at least be complete :-) and
I don't know Java at all well. Thank you for maintaining this project. I'm making these suggestions to hopefully improve the diagnostic \ “For every complex problem, there is a solution that is simple, | |
Thanks for your comments. One way I could do that is by passing a callback to the |
On 06-Nov-2016, Mohamed Zenadi wrote:
Sounds fine to me, I'll trust you with knowing the techniques :-) \ “If you can't beat them, arrange to have them beaten.” —George | |
This is being worked on :) |
What was left to work on for this one @zeapo ? |
In many failure scenarios (e.g. issue #153, issue #162, and others) the app presents a raw message from the jgit library.
The jgit library messages are very low-level, and the message presented to the user is lacking important context from the Password Store app about what it was doing when the jgit library raised an exception.
Please catch jgit library exceptions, at each point where useful contextual information from Password Store can be presented in a more useful diagnostic error message.
The text was updated successfully, but these errors were encountered: