Uniform error handling in frontend
Proposal:
Add a error function to aleksis.js that logs the error to console and notify user via snackbar. Arg is either a translation key, a string, or an object with error.message string. [1]
Handle graphQL errors in apollo.js [2] & emit an error event for further error handling (Actually this calls for exceptions, but does Vue support them?)
OR error event could be emitted in aleksis.js AND apollo.js calls this function with graphql.snackbar_error_message key.
[1] This is the first part of the handleError method currently separately implemented by InlineCRUDList.vue, ObjectCRUDList.vue, DialogObjectForm.vue and ForeignKeyField.vue
[2] The second part is graphQL error; proposed implementation:
this.$emit("error", error);
console.error(error);
this.$toastError("graphql.snackbar_error_message");