incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

Add more context to error messages

Open keon94 opened this issue 2 years ago • 4 comments

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

keon94 avatar Jun 09 '22 00:06 keon94

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.

keon94 avatar Jun 20 '22 16:06 keon94

Please be aware that @tanninghan has attached the UI design in https://github.com/apache/incubator-devlake/issues/1447

yumengwang03 avatar Jun 21 '22 08:06 yumengwang03

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.

github-actions[bot] avatar Jul 22 '22 00:07 github-actions[bot]

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.

github-actions[bot] avatar Jul 30 '22 00:07 github-actions[bot]

PR: #2763

keon94 avatar Aug 15 '22 16:08 keon94

@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.

keon94 avatar Aug 22 '22 13:08 keon94