I'm thinking it may make more sense, rather than having a ErrorApi, just to have a general AlertApi or SnackBarApi, and have .post() take an optional second argument for the variant to use.
This would be helpful in the plugin I'm building, which could benefit from a small dismissable alert on a page transition that informs the user that the API request they just made was successful.
What do you think about adding the SnackbarApi in addition to the ErrorApi? The rationale for having a separate error API is showing a snackbar is just one of many things you might want to do with errors that are reported by plugins. The current error api implementation would then be replaced with a thing wrapper that forwards the error to the snackbar api.
Maybe not name it "snackbar" - that's an implementation detail.
i can pick this up
Fixed in #605
Most helpful comment
Maybe not name it "snackbar" - that's an implementation detail.