incubator-devlake
incubator-devlake copied to clipboard
Add more context to error messages
What and why to refactor
Many plugin subtasks directly return errors without adding any extra context to the message. This makes troubleshooting difficult. For example, this, which might produce a Json unmarsal error, needs to have a message that additionally tells us something like "unable to get Input while extracting pull request commits".
Describe the solution you'd like
Identify all such plugin subtasks and wrap the error messages with more context.
Related issues
Similar to #1447
Additional context
n/a
For example, at every package level (or even function level) wrap the thrown error like this:
err = fmt.Errorf("error while doing X: %v", err)
and rethrow this new error.
Please be aware that @tanninghan has attached the UI design in https://github.com/apache/incubator-devlake/issues/1447
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.
PR: #2763
@Startrekzky @klesh As per our conversation in our weekly meeting, I've increased the scope on this issue to make the backend use a more robust error framework with support for user friendly messages, wrapped errors and stacktraces.