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

Define error handling strategy #33

Open
SimonSimCity opened this issue Mar 23, 2023 · 8 comments
Open

Define error handling strategy #33

SimonSimCity opened this issue Mar 23, 2023 · 8 comments

Comments

@SimonSimCity
Copy link
Collaborator

Currently we disregard all errors coming from a request to the API. An ideal outcome of this ticket would be a definition of how basic errors (e.g. server couldn't be reached/network down) could be handled - some kind of universal solution, which then would be implemented in all existing cases of failure and should be followed by all subsequent PRs.

@SimonSimCity SimonSimCity changed the title Error handling of api requests Define error handling strategy May 2, 2023
@SimonSimCity
Copy link
Collaborator Author

Not only our API can throw an error, but also other components. This is why the component <NuxtErrorBoundary> was introduced. I'm unsure about its effectiveness compared to the vue lifecycle onError, but all these things need to go in here as part of an error-reporting strategy. More on this: https://nuxt.com/docs/getting-started/error-handling#errors-during-the-vue-rendering-lifecycle-ssr-spa

@SimonSimCity
Copy link
Collaborator Author

SimonSimCity commented Jun 20, 2023

I see 3 categories of errors, which should be handled and logged differently:

  1. User relevant errors - the user has done something wrong. These errors should be shown to the user. Logging is not that relevant, because its nothing we should deal with, but maybe good to have them logged somewhere to improve UX by updating user-flows to avoid them. I don't see many cases for this being possible, because we only have limited space for user-input.
  2. Errors within this application (4-axis https://youtu.be/AdMqCUhvRz8?t=1201 - 4 min). Fatal errors will mostly be Electron internal, but the non-fatal ones are ours to deal with, which I wouldn't care much about as of now. Explicit ones can be logged, and for implicit ones monitoring system resources and user response can help.
  3. Errors in the API. While also part of non-fatal errors (explicit or implicit), both should IMO not be logged by this instance, but by the API. This includes an API not responding (could be our problem - API is down - or the users - network is disconnected) or returning a 5xx error-code.

A plan for the strategy of handling all errors:
For 1st we will need a way to report those errors, which should be discussed with @sclausendk. For 2nd and 3rd, we need a system to centrally report errors and exceptions but also to monitor abnormal system behavior. Logs of the 2nd category should be logged distinguishable from the 3rd. A set of developers should have access to the mentioned system and within a given time-frame (e.g. each month) have a look at the errors logged there and define action-items for handling them.

Development-tasks I see to fulfill the plan above:

  1. Decide on a system for reporting errors and logs and implementing it for Web and Electron.
  2. (low) Find out if there's a way of logging and reporting fatal errors (e.g. MacOS has crash-reports)
  3. (low) Define which system-metrics and user-actions to log to supervise implicit, non-fatal errors.

Next Steps:
This is just a set of ideas I have. @kkuepper Would be nice to get your opinion on this.

@SimonSimCity SimonSimCity removed their assignment Jun 20, 2023
@sifferhans
Copy link
Collaborator

Something like Bugsnag or Sentry could be nice, but I don't think they are self-hostable if that's a requirement.

@kkuepper kkuepper self-assigned this Jun 26, 2023
@kkuepper
Copy link
Member

I'd like to use ApplicationInsights for logging since we use that in the other projects as well. It probably makes sense that I set this up.
Sometimes it makes sense to use a more native solution for crash reporting. E.g. we use AppCenter for our Xamarin apps. That might be necessary in addition to ApplicationInsights, since it can't always be guaranteed that we manage to log to ApplicationInsights.

Do you have some examples for User relevant errors? Do you mean searching for something that doesn't exist and show a message that there are no results?

@SimonSimCity
Copy link
Collaborator Author

Do you have some examples for User relevant errors?

In general everything the user has access to change something - any kind of input. Search shouldn't have user-related errors (e.g. an empty search result is not an error), but when creating a playlist where one with the same name already exists is something we might not want to allow ... Another example is when opening a link which cannot be resolved by the router. The above is just a very general statement from my side. You could categorize them as explicit non-fatal errors on the 4-axis, but I still see them in a different responsibility - of the user.

@sifferhans
Copy link
Collaborator

Should this be discussed at the upcoming frivillighetshelg? Would be nice to get something working (ref #270).

@kkuepper
Copy link
Member

@sifferhans yes. that's a good idea.
I will be joining remotely. Your comment makes it sound like you'll be working on bmm-web as well?

@sifferhans
Copy link
Collaborator

@sifferhans yes. that's a good idea. I will be joining remotely. Your comment makes it sound like you'll be working on bmm-web as well?

I planned to, but i was needed in the orchestra under the easter camp, and we're using the frivillighetshelg for practice 😅
So I cannot join this time either, but I am planning to join next FH 👍🏼

@kkuepper kkuepper added this to the Link to BMM Web milestone Apr 10, 2024
@kkuepper kkuepper removed their assignment Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants